@nucypher/taco 0.4.0 → 0.6.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/README.md +0 -1
  2. package/dist/cjs/conditions/base/contract.d.ts +2 -432
  3. package/dist/cjs/conditions/base/contract.js +7 -80
  4. package/dist/cjs/conditions/base/contract.js.map +1 -1
  5. package/dist/cjs/conditions/base/index.d.ts +1 -0
  6. package/dist/cjs/conditions/base/index.js +2 -1
  7. package/dist/cjs/conditions/base/index.js.map +1 -1
  8. package/dist/cjs/conditions/base/json-api.d.ts +7 -0
  9. package/dist/cjs/conditions/base/json-api.js +19 -0
  10. package/dist/cjs/conditions/base/json-api.js.map +1 -0
  11. package/dist/cjs/conditions/base/rpc.d.ts +2 -42
  12. package/dist/cjs/conditions/base/rpc.js +7 -22
  13. package/dist/cjs/conditions/base/rpc.js.map +1 -1
  14. package/dist/cjs/conditions/base/time.d.ts +2 -40
  15. package/dist/cjs/conditions/base/time.js +8 -15
  16. package/dist/cjs/conditions/base/time.js.map +1 -1
  17. package/dist/cjs/conditions/compound-condition.d.ts +2 -4
  18. package/dist/cjs/conditions/compound-condition.js +7 -38
  19. package/dist/cjs/conditions/compound-condition.js.map +1 -1
  20. package/dist/cjs/conditions/condition-expr.d.ts +0 -3
  21. package/dist/cjs/conditions/condition-expr.js +0 -4
  22. package/dist/cjs/conditions/condition-expr.js.map +1 -1
  23. package/dist/cjs/conditions/condition-factory.js +11 -0
  24. package/dist/cjs/conditions/condition-factory.js.map +1 -1
  25. package/dist/cjs/conditions/condition.d.ts +1 -1
  26. package/dist/cjs/conditions/condition.js +3 -1
  27. package/dist/cjs/conditions/condition.js.map +1 -1
  28. package/dist/cjs/conditions/const.d.ts +1 -2
  29. package/dist/cjs/conditions/const.js +6 -8
  30. package/dist/cjs/conditions/const.js.map +1 -1
  31. package/dist/cjs/conditions/context/context.d.ts +15 -13
  32. package/dist/cjs/conditions/context/context.js +62 -56
  33. package/dist/cjs/conditions/context/context.js.map +1 -1
  34. package/dist/cjs/conditions/if-then-else-condition.d.ts +7 -0
  35. package/dist/cjs/conditions/if-then-else-condition.js +18 -0
  36. package/dist/cjs/conditions/if-then-else-condition.js.map +1 -0
  37. package/dist/cjs/conditions/index.d.ts +2 -0
  38. package/dist/cjs/conditions/index.js +3 -1
  39. package/dist/cjs/conditions/index.js.map +1 -1
  40. package/dist/cjs/conditions/multi-condition.d.ts +2 -0
  41. package/dist/cjs/conditions/multi-condition.js +35 -0
  42. package/dist/cjs/conditions/multi-condition.js.map +1 -0
  43. package/dist/cjs/conditions/schemas/common.d.ts +12 -0
  44. package/dist/cjs/conditions/schemas/common.js +36 -0
  45. package/dist/cjs/conditions/schemas/common.js.map +1 -0
  46. package/dist/cjs/conditions/schemas/compound.d.ts +4 -0
  47. package/dist/cjs/conditions/schemas/compound.js +36 -0
  48. package/dist/cjs/conditions/schemas/compound.js.map +1 -0
  49. package/dist/cjs/conditions/schemas/context.d.ts +3 -0
  50. package/dist/cjs/conditions/schemas/context.js +16 -0
  51. package/dist/cjs/conditions/schemas/context.js.map +1 -0
  52. package/dist/cjs/conditions/schemas/contract.d.ts +428 -0
  53. package/dist/cjs/conditions/schemas/contract.js +81 -0
  54. package/dist/cjs/conditions/schemas/contract.js.map +1 -0
  55. package/dist/cjs/conditions/schemas/if-then-else.d.ts +4 -0
  56. package/dist/cjs/conditions/schemas/if-then-else.js +40 -0
  57. package/dist/cjs/conditions/schemas/if-then-else.js.map +1 -0
  58. package/dist/cjs/conditions/schemas/json-api.d.ts +46 -0
  59. package/dist/cjs/conditions/schemas/json-api.js +37 -0
  60. package/dist/cjs/conditions/schemas/json-api.js.map +1 -0
  61. package/dist/cjs/conditions/schemas/return-value-test.d.ts +15 -0
  62. package/dist/cjs/conditions/schemas/return-value-test.js +11 -0
  63. package/dist/cjs/conditions/schemas/return-value-test.js.map +1 -0
  64. package/dist/cjs/conditions/schemas/rpc.d.ts +42 -0
  65. package/dist/cjs/conditions/schemas/rpc.js +58 -0
  66. package/dist/cjs/conditions/schemas/rpc.js.map +1 -0
  67. package/dist/cjs/conditions/schemas/sequential.d.ts +6 -0
  68. package/dist/cjs/conditions/schemas/sequential.js +39 -0
  69. package/dist/cjs/conditions/schemas/sequential.js.map +1 -0
  70. package/dist/cjs/conditions/schemas/time.d.ts +40 -0
  71. package/dist/cjs/conditions/schemas/time.js +16 -0
  72. package/dist/cjs/conditions/schemas/time.js.map +1 -0
  73. package/dist/cjs/conditions/schemas/utils.d.ts +2 -0
  74. package/dist/cjs/conditions/schemas/utils.js +21 -0
  75. package/dist/cjs/conditions/schemas/utils.js.map +1 -0
  76. package/dist/cjs/conditions/sequential.d.ts +7 -0
  77. package/dist/cjs/conditions/sequential.js +18 -0
  78. package/dist/cjs/conditions/sequential.js.map +1 -0
  79. package/dist/cjs/conditions/shared.d.ts +2 -19
  80. package/dist/cjs/conditions/shared.js +6 -32
  81. package/dist/cjs/conditions/shared.js.map +1 -1
  82. package/dist/cjs/dkg.d.ts +1 -1
  83. package/dist/cjs/dkg.js +2 -2
  84. package/dist/cjs/dkg.js.map +1 -1
  85. package/dist/cjs/index.d.ts +2 -3
  86. package/dist/cjs/index.js +2 -8
  87. package/dist/cjs/index.js.map +1 -1
  88. package/dist/cjs/taco.d.ts +5 -23
  89. package/dist/cjs/taco.js +9 -36
  90. package/dist/cjs/taco.js.map +1 -1
  91. package/dist/cjs/tdec.d.ts +3 -4
  92. package/dist/cjs/tdec.js +11 -8
  93. package/dist/cjs/tdec.js.map +1 -1
  94. package/dist/es/conditions/base/contract.d.ts +2 -432
  95. package/dist/es/conditions/base/contract.js +2 -77
  96. package/dist/es/conditions/base/contract.js.map +1 -1
  97. package/dist/es/conditions/base/index.d.ts +1 -0
  98. package/dist/es/conditions/base/index.js +1 -0
  99. package/dist/es/conditions/base/index.js.map +1 -1
  100. package/dist/es/conditions/base/json-api.d.ts +7 -0
  101. package/dist/es/conditions/base/json-api.js +12 -0
  102. package/dist/es/conditions/base/json-api.js.map +1 -0
  103. package/dist/es/conditions/base/rpc.d.ts +2 -42
  104. package/dist/es/conditions/base/rpc.js +2 -16
  105. package/dist/es/conditions/base/rpc.js.map +1 -1
  106. package/dist/es/conditions/base/time.d.ts +2 -40
  107. package/dist/es/conditions/base/time.js +2 -12
  108. package/dist/es/conditions/base/time.js.map +1 -1
  109. package/dist/es/conditions/compound-condition.d.ts +2 -4
  110. package/dist/es/conditions/compound-condition.js +2 -35
  111. package/dist/es/conditions/compound-condition.js.map +1 -1
  112. package/dist/es/conditions/condition-expr.d.ts +0 -3
  113. package/dist/es/conditions/condition-expr.js +0 -4
  114. package/dist/es/conditions/condition-expr.js.map +1 -1
  115. package/dist/es/conditions/condition-factory.js +11 -0
  116. package/dist/es/conditions/condition-factory.js.map +1 -1
  117. package/dist/es/conditions/condition.d.ts +1 -1
  118. package/dist/es/conditions/condition.js +1 -0
  119. package/dist/es/conditions/condition.js.map +1 -1
  120. package/dist/es/conditions/const.d.ts +1 -2
  121. package/dist/es/conditions/const.js +5 -7
  122. package/dist/es/conditions/const.js.map +1 -1
  123. package/dist/es/conditions/context/context.d.ts +15 -13
  124. package/dist/es/conditions/context/context.js +63 -57
  125. package/dist/es/conditions/context/context.js.map +1 -1
  126. package/dist/es/conditions/if-then-else-condition.d.ts +7 -0
  127. package/dist/es/conditions/if-then-else-condition.js +12 -0
  128. package/dist/es/conditions/if-then-else-condition.js.map +1 -0
  129. package/dist/es/conditions/index.d.ts +2 -0
  130. package/dist/es/conditions/index.js +2 -0
  131. package/dist/es/conditions/index.js.map +1 -1
  132. package/dist/es/conditions/multi-condition.d.ts +2 -0
  133. package/dist/es/conditions/multi-condition.js +31 -0
  134. package/dist/es/conditions/multi-condition.js.map +1 -0
  135. package/dist/es/conditions/schemas/common.d.ts +12 -0
  136. package/dist/es/conditions/schemas/common.js +33 -0
  137. package/dist/es/conditions/schemas/common.js.map +1 -0
  138. package/dist/es/conditions/schemas/compound.d.ts +4 -0
  139. package/dist/es/conditions/schemas/compound.js +33 -0
  140. package/dist/es/conditions/schemas/compound.js.map +1 -0
  141. package/dist/es/conditions/schemas/context.d.ts +3 -0
  142. package/dist/es/conditions/schemas/context.js +13 -0
  143. package/dist/es/conditions/schemas/context.js.map +1 -0
  144. package/dist/es/conditions/schemas/contract.d.ts +428 -0
  145. package/dist/es/conditions/schemas/contract.js +78 -0
  146. package/dist/es/conditions/schemas/contract.js.map +1 -0
  147. package/dist/es/conditions/schemas/if-then-else.d.ts +4 -0
  148. package/dist/es/conditions/schemas/if-then-else.js +37 -0
  149. package/dist/es/conditions/schemas/if-then-else.js.map +1 -0
  150. package/dist/es/conditions/schemas/json-api.d.ts +46 -0
  151. package/dist/es/conditions/schemas/json-api.js +34 -0
  152. package/dist/es/conditions/schemas/json-api.js.map +1 -0
  153. package/dist/es/conditions/schemas/return-value-test.d.ts +15 -0
  154. package/dist/es/conditions/schemas/return-value-test.js +8 -0
  155. package/dist/es/conditions/schemas/return-value-test.js.map +1 -0
  156. package/dist/es/conditions/schemas/rpc.d.ts +42 -0
  157. package/dist/es/conditions/schemas/rpc.js +32 -0
  158. package/dist/es/conditions/schemas/rpc.js.map +1 -0
  159. package/dist/es/conditions/schemas/sequential.d.ts +6 -0
  160. package/dist/es/conditions/schemas/sequential.js +36 -0
  161. package/dist/es/conditions/schemas/sequential.js.map +1 -0
  162. package/dist/es/conditions/schemas/time.d.ts +40 -0
  163. package/dist/es/conditions/schemas/time.js +13 -0
  164. package/dist/es/conditions/schemas/time.js.map +1 -0
  165. package/dist/es/conditions/schemas/utils.d.ts +2 -0
  166. package/dist/es/conditions/schemas/utils.js +18 -0
  167. package/dist/es/conditions/schemas/utils.js.map +1 -0
  168. package/dist/es/conditions/sequential.d.ts +7 -0
  169. package/dist/es/conditions/sequential.js +12 -0
  170. package/dist/es/conditions/sequential.js.map +1 -0
  171. package/dist/es/conditions/shared.d.ts +2 -19
  172. package/dist/es/conditions/shared.js +2 -33
  173. package/dist/es/conditions/shared.js.map +1 -1
  174. package/dist/es/dkg.d.ts +1 -1
  175. package/dist/es/dkg.js +2 -2
  176. package/dist/es/dkg.js.map +1 -1
  177. package/dist/es/index.d.ts +2 -3
  178. package/dist/es/index.js +2 -5
  179. package/dist/es/index.js.map +1 -1
  180. package/dist/es/taco.d.ts +5 -23
  181. package/dist/es/taco.js +9 -34
  182. package/dist/es/taco.js.map +1 -1
  183. package/dist/es/tdec.d.ts +3 -4
  184. package/dist/es/tdec.js +12 -9
  185. package/dist/es/tdec.js.map +1 -1
  186. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  187. package/dist/tsconfig.es.tsbuildinfo +1 -1
  188. package/package.json +7 -6
@@ -0,0 +1,428 @@
1
+ import { z } from 'zod';
2
+ declare const functionAbiSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
3
+ name: z.ZodString;
4
+ type: z.ZodLiteral<"function">;
5
+ inputs: z.ZodArray<z.ZodObject<{
6
+ name: z.ZodString;
7
+ type: z.ZodEnum<[string, ...string[]]>;
8
+ internalType: z.ZodEnum<[string, ...string[]]>;
9
+ }, "strict", z.ZodTypeAny, {
10
+ type: string;
11
+ name: string;
12
+ internalType: string;
13
+ }, {
14
+ type: string;
15
+ name: string;
16
+ internalType: string;
17
+ }>, "many">;
18
+ outputs: z.ZodArray<z.ZodObject<{
19
+ name: z.ZodString;
20
+ type: z.ZodEnum<[string, ...string[]]>;
21
+ internalType: z.ZodEnum<[string, ...string[]]>;
22
+ }, "strict", z.ZodTypeAny, {
23
+ type: string;
24
+ name: string;
25
+ internalType: string;
26
+ }, {
27
+ type: string;
28
+ name: string;
29
+ internalType: string;
30
+ }>, "atleastone">;
31
+ stateMutability: z.ZodUnion<[z.ZodLiteral<"view">, z.ZodLiteral<"pure">]>;
32
+ }, "strict", z.ZodTypeAny, {
33
+ type: "function";
34
+ name: string;
35
+ inputs: {
36
+ type: string;
37
+ name: string;
38
+ internalType: string;
39
+ }[];
40
+ outputs: [{
41
+ type: string;
42
+ name: string;
43
+ internalType: string;
44
+ }, ...{
45
+ type: string;
46
+ name: string;
47
+ internalType: string;
48
+ }[]];
49
+ stateMutability: "view" | "pure";
50
+ }, {
51
+ type: "function";
52
+ name: string;
53
+ inputs: {
54
+ type: string;
55
+ name: string;
56
+ internalType: string;
57
+ }[];
58
+ outputs: [{
59
+ type: string;
60
+ name: string;
61
+ internalType: string;
62
+ }, ...{
63
+ type: string;
64
+ name: string;
65
+ internalType: string;
66
+ }[]];
67
+ stateMutability: "view" | "pure";
68
+ }>, {
69
+ type: "function";
70
+ name: string;
71
+ inputs: {
72
+ type: string;
73
+ name: string;
74
+ internalType: string;
75
+ }[];
76
+ outputs: [{
77
+ type: string;
78
+ name: string;
79
+ internalType: string;
80
+ }, ...{
81
+ type: string;
82
+ name: string;
83
+ internalType: string;
84
+ }[]];
85
+ stateMutability: "view" | "pure";
86
+ }, {
87
+ type: "function";
88
+ name: string;
89
+ inputs: {
90
+ type: string;
91
+ name: string;
92
+ internalType: string;
93
+ }[];
94
+ outputs: [{
95
+ type: string;
96
+ name: string;
97
+ internalType: string;
98
+ }, ...{
99
+ type: string;
100
+ name: string;
101
+ internalType: string;
102
+ }[]];
103
+ stateMutability: "view" | "pure";
104
+ }>, {
105
+ type: "function";
106
+ name: string;
107
+ inputs: {
108
+ type: string;
109
+ name: string;
110
+ internalType: string;
111
+ }[];
112
+ outputs: [{
113
+ type: string;
114
+ name: string;
115
+ internalType: string;
116
+ }, ...{
117
+ type: string;
118
+ name: string;
119
+ internalType: string;
120
+ }[]];
121
+ stateMutability: "view" | "pure";
122
+ }, {
123
+ type: "function";
124
+ name: string;
125
+ inputs: {
126
+ type: string;
127
+ name: string;
128
+ internalType: string;
129
+ }[];
130
+ outputs: [{
131
+ type: string;
132
+ name: string;
133
+ internalType: string;
134
+ }, ...{
135
+ type: string;
136
+ name: string;
137
+ internalType: string;
138
+ }[]];
139
+ stateMutability: "view" | "pure";
140
+ }>;
141
+ export type FunctionAbiProps = z.infer<typeof functionAbiSchema>;
142
+ export declare const ContractConditionType = "contract";
143
+ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<{
144
+ returnValueTest: z.ZodObject<{
145
+ index: z.ZodOptional<z.ZodNumber>;
146
+ comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
147
+ value: z.ZodType<any, z.ZodTypeDef, any>;
148
+ }, "strip", z.ZodTypeAny, {
149
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
150
+ index?: number | undefined;
151
+ value?: any;
152
+ }, {
153
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
154
+ index?: number | undefined;
155
+ value?: any;
156
+ }>;
157
+ chain: z.ZodNever | z.ZodLiteral<z.Primitive> | z.ZodUnion<[z.ZodLiteral<z.Primitive>, z.ZodLiteral<z.Primitive>, ...z.ZodLiteral<z.Primitive>[]]>;
158
+ conditionType: z.ZodDefault<z.ZodLiteral<"contract">>;
159
+ contractAddress: z.ZodEffects<z.ZodString, string, string>;
160
+ standardContractType: z.ZodOptional<z.ZodEnum<["ERC20", "ERC721"]>>;
161
+ method: z.ZodString;
162
+ functionAbi: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodObject<{
163
+ name: z.ZodString;
164
+ type: z.ZodLiteral<"function">;
165
+ inputs: z.ZodArray<z.ZodObject<{
166
+ name: z.ZodString;
167
+ type: z.ZodEnum<[string, ...string[]]>;
168
+ internalType: z.ZodEnum<[string, ...string[]]>;
169
+ }, "strict", z.ZodTypeAny, {
170
+ type: string;
171
+ name: string;
172
+ internalType: string;
173
+ }, {
174
+ type: string;
175
+ name: string;
176
+ internalType: string;
177
+ }>, "many">;
178
+ outputs: z.ZodArray<z.ZodObject<{
179
+ name: z.ZodString;
180
+ type: z.ZodEnum<[string, ...string[]]>;
181
+ internalType: z.ZodEnum<[string, ...string[]]>;
182
+ }, "strict", z.ZodTypeAny, {
183
+ type: string;
184
+ name: string;
185
+ internalType: string;
186
+ }, {
187
+ type: string;
188
+ name: string;
189
+ internalType: string;
190
+ }>, "atleastone">;
191
+ stateMutability: z.ZodUnion<[z.ZodLiteral<"view">, z.ZodLiteral<"pure">]>;
192
+ }, "strict", z.ZodTypeAny, {
193
+ type: "function";
194
+ name: string;
195
+ inputs: {
196
+ type: string;
197
+ name: string;
198
+ internalType: string;
199
+ }[];
200
+ outputs: [{
201
+ type: string;
202
+ name: string;
203
+ internalType: string;
204
+ }, ...{
205
+ type: string;
206
+ name: string;
207
+ internalType: string;
208
+ }[]];
209
+ stateMutability: "view" | "pure";
210
+ }, {
211
+ type: "function";
212
+ name: string;
213
+ inputs: {
214
+ type: string;
215
+ name: string;
216
+ internalType: string;
217
+ }[];
218
+ outputs: [{
219
+ type: string;
220
+ name: string;
221
+ internalType: string;
222
+ }, ...{
223
+ type: string;
224
+ name: string;
225
+ internalType: string;
226
+ }[]];
227
+ stateMutability: "view" | "pure";
228
+ }>, {
229
+ type: "function";
230
+ name: string;
231
+ inputs: {
232
+ type: string;
233
+ name: string;
234
+ internalType: string;
235
+ }[];
236
+ outputs: [{
237
+ type: string;
238
+ name: string;
239
+ internalType: string;
240
+ }, ...{
241
+ type: string;
242
+ name: string;
243
+ internalType: string;
244
+ }[]];
245
+ stateMutability: "view" | "pure";
246
+ }, {
247
+ type: "function";
248
+ name: string;
249
+ inputs: {
250
+ type: string;
251
+ name: string;
252
+ internalType: string;
253
+ }[];
254
+ outputs: [{
255
+ type: string;
256
+ name: string;
257
+ internalType: string;
258
+ }, ...{
259
+ type: string;
260
+ name: string;
261
+ internalType: string;
262
+ }[]];
263
+ stateMutability: "view" | "pure";
264
+ }>, {
265
+ type: "function";
266
+ name: string;
267
+ inputs: {
268
+ type: string;
269
+ name: string;
270
+ internalType: string;
271
+ }[];
272
+ outputs: [{
273
+ type: string;
274
+ name: string;
275
+ internalType: string;
276
+ }, ...{
277
+ type: string;
278
+ name: string;
279
+ internalType: string;
280
+ }[]];
281
+ stateMutability: "view" | "pure";
282
+ }, {
283
+ type: "function";
284
+ name: string;
285
+ inputs: {
286
+ type: string;
287
+ name: string;
288
+ internalType: string;
289
+ }[];
290
+ outputs: [{
291
+ type: string;
292
+ name: string;
293
+ internalType: string;
294
+ }, ...{
295
+ type: string;
296
+ name: string;
297
+ internalType: string;
298
+ }[]];
299
+ stateMutability: "view" | "pure";
300
+ }>>;
301
+ parameters: z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">;
302
+ }, "strip", z.ZodTypeAny, {
303
+ conditionType: "contract";
304
+ parameters: any[];
305
+ returnValueTest: {
306
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
307
+ index?: number | undefined;
308
+ value?: any;
309
+ };
310
+ method: string;
311
+ contractAddress: string;
312
+ chain?: z.Primitive;
313
+ standardContractType?: "ERC20" | "ERC721" | undefined;
314
+ functionAbi?: {
315
+ type: "function";
316
+ name: string;
317
+ inputs: {
318
+ type: string;
319
+ name: string;
320
+ internalType: string;
321
+ }[];
322
+ outputs: [{
323
+ type: string;
324
+ name: string;
325
+ internalType: string;
326
+ }, ...{
327
+ type: string;
328
+ name: string;
329
+ internalType: string;
330
+ }[]];
331
+ stateMutability: "view" | "pure";
332
+ } | undefined;
333
+ }, {
334
+ parameters: any[];
335
+ returnValueTest: {
336
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
337
+ index?: number | undefined;
338
+ value?: any;
339
+ };
340
+ method: string;
341
+ contractAddress: string;
342
+ chain?: z.Primitive;
343
+ conditionType?: "contract" | undefined;
344
+ standardContractType?: "ERC20" | "ERC721" | undefined;
345
+ functionAbi?: {
346
+ type: "function";
347
+ name: string;
348
+ inputs: {
349
+ type: string;
350
+ name: string;
351
+ internalType: string;
352
+ }[];
353
+ outputs: [{
354
+ type: string;
355
+ name: string;
356
+ internalType: string;
357
+ }, ...{
358
+ type: string;
359
+ name: string;
360
+ internalType: string;
361
+ }[]];
362
+ stateMutability: "view" | "pure";
363
+ } | undefined;
364
+ }>, {
365
+ conditionType: "contract";
366
+ parameters: any[];
367
+ returnValueTest: {
368
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
369
+ index?: number | undefined;
370
+ value?: any;
371
+ };
372
+ method: string;
373
+ contractAddress: string;
374
+ chain?: z.Primitive;
375
+ standardContractType?: "ERC20" | "ERC721" | undefined;
376
+ functionAbi?: {
377
+ type: "function";
378
+ name: string;
379
+ inputs: {
380
+ type: string;
381
+ name: string;
382
+ internalType: string;
383
+ }[];
384
+ outputs: [{
385
+ type: string;
386
+ name: string;
387
+ internalType: string;
388
+ }, ...{
389
+ type: string;
390
+ name: string;
391
+ internalType: string;
392
+ }[]];
393
+ stateMutability: "view" | "pure";
394
+ } | undefined;
395
+ }, {
396
+ parameters: any[];
397
+ returnValueTest: {
398
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
399
+ index?: number | undefined;
400
+ value?: any;
401
+ };
402
+ method: string;
403
+ contractAddress: string;
404
+ chain?: z.Primitive;
405
+ conditionType?: "contract" | undefined;
406
+ standardContractType?: "ERC20" | "ERC721" | undefined;
407
+ functionAbi?: {
408
+ type: "function";
409
+ name: string;
410
+ inputs: {
411
+ type: string;
412
+ name: string;
413
+ internalType: string;
414
+ }[];
415
+ outputs: [{
416
+ type: string;
417
+ name: string;
418
+ internalType: string;
419
+ }, ...{
420
+ type: string;
421
+ name: string;
422
+ internalType: string;
423
+ }[]];
424
+ stateMutability: "view" | "pure";
425
+ } | undefined;
426
+ }>;
427
+ export type ContractConditionProps = z.infer<typeof contractConditionSchema>;
428
+ export {};
@@ -0,0 +1,78 @@
1
+ import { EthAddressSchema } from '@nucypher/shared';
2
+ import { ethers } from 'ethers';
3
+ import { z } from 'zod';
4
+ import { paramOrContextParamSchema } from './context';
5
+ import { rpcConditionSchema } from './rpc';
6
+ // TODO: Consider replacing with `z.unknown`:
7
+ // Since Solidity types are tied to Solidity version, we may not be able to accurately represent them in Zod.
8
+ // Alternatively, find a TS Solidity type lib.
9
+ const EthBaseTypes = [
10
+ 'bool',
11
+ 'string',
12
+ 'address',
13
+ 'address payable',
14
+ ...Array.from({ length: 32 }, (_v, i) => `bytes${i + 1}`), // bytes1 through bytes32
15
+ 'bytes',
16
+ ...Array.from({ length: 32 }, (_v, i) => `uint${8 * (i + 1)}`), // uint8 through uint256
17
+ ...Array.from({ length: 32 }, (_v, i) => `int${8 * (i + 1)}`), // int8 through int256
18
+ ];
19
+ const functionAbiVariableSchema = z
20
+ .object({
21
+ name: z.string(),
22
+ type: z.enum(EthBaseTypes),
23
+ internalType: z.enum(EthBaseTypes), // TODO: Do we need to validate this?
24
+ })
25
+ .strict();
26
+ const functionAbiSchema = z
27
+ .object({
28
+ name: z.string(),
29
+ type: z.literal('function'),
30
+ inputs: z.array(functionAbiVariableSchema).min(0),
31
+ outputs: z.array(functionAbiVariableSchema).nonempty(),
32
+ stateMutability: z.union([z.literal('view'), z.literal('pure')]),
33
+ })
34
+ .strict()
35
+ .refine((functionAbi) => {
36
+ let asInterface;
37
+ try {
38
+ // `stringify` here because ethers.utils.Interface doesn't accept a Zod schema
39
+ asInterface = new ethers.utils.Interface(JSON.stringify([functionAbi]));
40
+ }
41
+ catch (e) {
42
+ return false;
43
+ }
44
+ const functionsInAbi = Object.values(asInterface.functions || {});
45
+ return functionsInAbi.length === 1;
46
+ }, {
47
+ message: '"functionAbi" must contain a single function definition',
48
+ path: ['functionAbi'],
49
+ })
50
+ .refine((functionAbi) => {
51
+ const asInterface = new ethers.utils.Interface(JSON.stringify([functionAbi]));
52
+ const nrOfInputs = asInterface.fragments[0].inputs.length;
53
+ return functionAbi.inputs.length === nrOfInputs;
54
+ }, {
55
+ message: '"parameters" must have the same length as "functionAbi.inputs"',
56
+ path: ['parameters'],
57
+ });
58
+ export const ContractConditionType = 'contract';
59
+ export const contractConditionSchema = rpcConditionSchema
60
+ .extend({
61
+ conditionType: z
62
+ .literal(ContractConditionType)
63
+ .default(ContractConditionType),
64
+ contractAddress: EthAddressSchema,
65
+ standardContractType: z.enum(['ERC20', 'ERC721']).optional(),
66
+ method: z.string(),
67
+ functionAbi: functionAbiSchema.optional(),
68
+ parameters: z.array(paramOrContextParamSchema),
69
+ })
70
+ // Adding this custom logic causes the return type to be ZodEffects instead of ZodObject
71
+ // https://github.com/colinhacks/zod/issues/2474
72
+ .refine(
73
+ // A check to see if either 'standardContractType' or 'functionAbi' is set
74
+ (data) => Boolean(data.standardContractType) !== Boolean(data.functionAbi), {
75
+ message: "At most one of the fields 'standardContractType' and 'functionAbi' must be defined",
76
+ path: ['standardContractType'],
77
+ });
78
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C,6CAA6C;AAC7C,gHAAgH;AAChH,iDAAiD;AACjD,MAAM,YAAY,GAA0B;IAC1C,MAAM;IACN,QAAQ;IACR,SAAS;IACT,iBAAiB;IACjB,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,yBAAyB;IACpF,OAAO;IACP,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,wBAAwB;IACxF,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,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EAC1E;IACE,OAAO,EACL,oFAAoF;IACtF,IAAI,EAAE,CAAC,sBAAsB,CAAC;CAC/B,CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { z } from 'zod';
2
+ export declare const IfThenElseConditionType = "if-then-else";
3
+ export declare const ifThenElseConditionSchema: z.ZodSchema;
4
+ export type IfThenElseConditionProps = z.infer<typeof ifThenElseConditionSchema>;
@@ -0,0 +1,37 @@
1
+ import { z } from 'zod';
2
+ import { maxNestedDepth } from '../multi-condition';
3
+ import { baseConditionSchema } from './common';
4
+ import { anyConditionSchema } from './utils';
5
+ export const IfThenElseConditionType = 'if-then-else';
6
+ export const ifThenElseConditionSchema = z.lazy(() => baseConditionSchema
7
+ .extend({
8
+ conditionType: z
9
+ .literal(IfThenElseConditionType)
10
+ .default(IfThenElseConditionType),
11
+ ifCondition: anyConditionSchema,
12
+ thenCondition: anyConditionSchema,
13
+ elseCondition: z.union([anyConditionSchema, z.boolean()]),
14
+ })
15
+ .refine(
16
+ // already at 2nd level since checking member condition
17
+ (condition) => maxNestedDepth(2)(condition.ifCondition, 2), {
18
+ message: 'Exceeded max nested depth of 2 for multi-condition type',
19
+ path: ['ifCondition'],
20
+ })
21
+ .refine(
22
+ // already at 2nd level since checking member condition
23
+ (condition) => maxNestedDepth(2)(condition.thenCondition, 2), {
24
+ message: 'Exceeded max nested depth of 2 for multi-condition type',
25
+ path: ['thenCondition'],
26
+ })
27
+ .refine((condition) => {
28
+ if (typeof condition.elseCondition !== 'boolean') {
29
+ // already at 2nd level since checking member condition
30
+ return maxNestedDepth(2)(condition.elseCondition, 2);
31
+ }
32
+ return true;
33
+ }, {
34
+ message: 'Exceeded max nested depth of 2 for multi-condition type',
35
+ path: ['elseCondition'],
36
+ }));
37
+ //# sourceMappingURL=if-then-else.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"if-then-else.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/if-then-else.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,C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AI,CAAC;AACd,CAAC,EACD;IACE,OAAO,EAAE,yDAAyD;IAClE,IAAI,EAAE,CAAC,eAAe,CAAC;CACxB,CACF,CACJ,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ export declare const JsonApiConditionType = "json-api";
3
+ export declare const jsonPathSchema: z.ZodEffects<z.ZodString, string, string>;
4
+ export declare const jsonApiConditionSchema: z.ZodObject<{
5
+ conditionType: z.ZodDefault<z.ZodLiteral<"json-api">>;
6
+ endpoint: z.ZodString;
7
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
8
+ query: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
9
+ authorizationToken: z.ZodOptional<z.ZodString>;
10
+ returnValueTest: z.ZodObject<{
11
+ index: z.ZodOptional<z.ZodNumber>;
12
+ comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
13
+ value: z.ZodType<any, z.ZodTypeDef, any>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
16
+ index?: number | undefined;
17
+ value?: any;
18
+ }, {
19
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
20
+ index?: number | undefined;
21
+ value?: any;
22
+ }>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ conditionType: "json-api";
25
+ endpoint: string;
26
+ returnValueTest: {
27
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
28
+ index?: number | undefined;
29
+ value?: any;
30
+ };
31
+ parameters?: Record<string, unknown> | undefined;
32
+ query?: string | undefined;
33
+ authorizationToken?: string | undefined;
34
+ }, {
35
+ endpoint: string;
36
+ returnValueTest: {
37
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
38
+ index?: number | undefined;
39
+ value?: any;
40
+ };
41
+ conditionType?: "json-api" | undefined;
42
+ parameters?: Record<string, unknown> | undefined;
43
+ query?: string | undefined;
44
+ authorizationToken?: string | undefined;
45
+ }>;
46
+ export type JsonApiConditionProps = z.infer<typeof jsonApiConditionSchema>;
@@ -0,0 +1,34 @@
1
+ import { JSONPath } from '@astronautlabs/jsonpath';
2
+ import { z } from 'zod';
3
+ import { CONTEXT_PARAM_REGEXP } from '../const';
4
+ import { contextParamSchema } from './context';
5
+ import { returnValueTestSchema } from './return-value-test';
6
+ export const JsonApiConditionType = 'json-api';
7
+ const validateJSONPath = (jsonPath) => {
8
+ // account for embedded context variables
9
+ if (CONTEXT_PARAM_REGEXP.test(jsonPath)) {
10
+ // skip validation
11
+ return true;
12
+ }
13
+ try {
14
+ JSONPath.parse(jsonPath);
15
+ return true;
16
+ }
17
+ catch (error) {
18
+ return false;
19
+ }
20
+ };
21
+ export const jsonPathSchema = z
22
+ .string()
23
+ .refine((val) => validateJSONPath(val), {
24
+ message: 'Invalid JSONPath expression',
25
+ });
26
+ export const jsonApiConditionSchema = z.object({
27
+ conditionType: z.literal(JsonApiConditionType).default(JsonApiConditionType),
28
+ endpoint: z.string().url(),
29
+ parameters: z.record(z.string(), z.unknown()).optional(),
30
+ query: jsonPathSchema.optional(),
31
+ authorizationToken: contextParamSchema.optional(),
32
+ returnValueTest: returnValueTestSchema, // Update to allow multiple return values after expanding supported methods
33
+ });
34
+ //# sourceMappingURL=json-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-api.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/json-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE/C,MAAM,gBAAgB,GAAG,CAAC,QAAgB,EAAW,EAAE;IACrD,yCAAyC;IACzC,IAAI,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxC,kBAAkB;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE;IACtC,OAAO,EAAE,6BAA6B;CACvC,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC5E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxD,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE;IAChC,kBAAkB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACjD,eAAe,EAAE,qBAAqB,EAAE,2EAA2E;CACpH,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export declare const returnValueTestSchema: z.ZodObject<{
3
+ index: z.ZodOptional<z.ZodNumber>;
4
+ comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
5
+ value: z.ZodType<any, z.ZodTypeDef, any>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
8
+ index?: number | undefined;
9
+ value?: any;
10
+ }, {
11
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
12
+ index?: number | undefined;
13
+ value?: any;
14
+ }>;
15
+ export type ReturnValueTestProps = z.infer<typeof returnValueTestSchema>;
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { paramOrContextParamSchema } from './context';
3
+ export const returnValueTestSchema = z.object({
4
+ index: z.number().int().nonnegative().optional(),
5
+ comparator: z.enum(['==', '>', '<', '>=', '<=', '!=']),
6
+ value: paramOrContextParamSchema,
7
+ });
8
+ //# sourceMappingURL=return-value-test.js.map
@@ -0,0 +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,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,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,CAAC,CAAC;IACtD,KAAK,EAAE,yBAAyB;CACjC,CAAC,CAAC"}