@degenerate/generic 0.2.6 → 0.2.7

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.
@@ -0,0 +1,439 @@
1
+ import { z } from 'zod';
2
+ import { SAFETransactionType, SAFETransactionActionType } from '../safe-transaction-models';
3
+ /**
4
+ * This is the data for the function in the SAFE Ecosystem.
5
+ */
6
+ export declare const ISAFETransactionFunctionDataSchema: z.ZodObject<{
7
+ functionId: z.ZodString;
8
+ functionName: z.ZodString;
9
+ functionData: z.ZodRecord<z.ZodString, z.ZodAny>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ functionId: string;
12
+ functionName: string;
13
+ functionData: Record<string, any>;
14
+ }, {
15
+ functionId: string;
16
+ functionName: string;
17
+ functionData: Record<string, any>;
18
+ }>;
19
+ export type ISAFETransactionFunctionData = z.infer<typeof ISAFETransactionFunctionDataSchema>;
20
+ /**
21
+ * This is the transaction targeting a function in the SAFE Ecosystem.
22
+ */
23
+ export declare const ISAFETransactionFunctionSchema: z.ZodObject<z.objectUtil.extendShape<{
24
+ createdAt: z.ZodNumber;
25
+ authority: z.ZodString;
26
+ authoritySignature: z.ZodString;
27
+ transaction: z.ZodObject<{
28
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
29
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
32
+ action: "ADD" | "DELETE" | "UPDATE";
33
+ }, {
34
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
35
+ action: "ADD" | "DELETE" | "UPDATE";
36
+ }>;
37
+ version: z.ZodNumber;
38
+ }, {
39
+ transaction: z.ZodObject<{
40
+ type: z.ZodLiteral<SAFETransactionType.FUNCTIONS>;
41
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
42
+ data: z.ZodObject<{
43
+ functionId: z.ZodString;
44
+ functionName: z.ZodString;
45
+ functionData: z.ZodRecord<z.ZodString, z.ZodAny>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ functionId: string;
48
+ functionName: string;
49
+ functionData: Record<string, any>;
50
+ }, {
51
+ functionId: string;
52
+ functionName: string;
53
+ functionData: Record<string, any>;
54
+ }>;
55
+ }, "strip", z.ZodTypeAny, {
56
+ type: SAFETransactionType.FUNCTIONS;
57
+ action: "ADD" | "DELETE" | "UPDATE";
58
+ data: {
59
+ functionId: string;
60
+ functionName: string;
61
+ functionData: Record<string, any>;
62
+ };
63
+ }, {
64
+ type: SAFETransactionType.FUNCTIONS;
65
+ action: "ADD" | "DELETE" | "UPDATE";
66
+ data: {
67
+ functionId: string;
68
+ functionName: string;
69
+ functionData: Record<string, any>;
70
+ };
71
+ }>;
72
+ version: z.ZodNumber;
73
+ }>, "strip", z.ZodTypeAny, {
74
+ createdAt: number;
75
+ version: number;
76
+ authority: string;
77
+ authoritySignature: string;
78
+ transaction: {
79
+ type: SAFETransactionType.FUNCTIONS;
80
+ action: "ADD" | "DELETE" | "UPDATE";
81
+ data: {
82
+ functionId: string;
83
+ functionName: string;
84
+ functionData: Record<string, any>;
85
+ };
86
+ };
87
+ }, {
88
+ createdAt: number;
89
+ version: number;
90
+ authority: string;
91
+ authoritySignature: string;
92
+ transaction: {
93
+ type: SAFETransactionType.FUNCTIONS;
94
+ action: "ADD" | "DELETE" | "UPDATE";
95
+ data: {
96
+ functionId: string;
97
+ functionName: string;
98
+ functionData: Record<string, any>;
99
+ };
100
+ };
101
+ }>;
102
+ export type ISAFETransactionFunction = z.infer<typeof ISAFETransactionFunctionSchema>;
103
+ /**
104
+ * This is the schema for the function transaction add.
105
+ */
106
+ export declare const ISAFETransactionFunctionAddSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
107
+ createdAt: z.ZodNumber;
108
+ authority: z.ZodString;
109
+ authoritySignature: z.ZodString;
110
+ transaction: z.ZodObject<{
111
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
112
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
115
+ action: "ADD" | "DELETE" | "UPDATE";
116
+ }, {
117
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
118
+ action: "ADD" | "DELETE" | "UPDATE";
119
+ }>;
120
+ version: z.ZodNumber;
121
+ }, {
122
+ transaction: z.ZodObject<{
123
+ type: z.ZodLiteral<SAFETransactionType.FUNCTIONS>;
124
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
125
+ data: z.ZodObject<{
126
+ functionId: z.ZodString;
127
+ functionName: z.ZodString;
128
+ functionData: z.ZodRecord<z.ZodString, z.ZodAny>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ functionId: string;
131
+ functionName: string;
132
+ functionData: Record<string, any>;
133
+ }, {
134
+ functionId: string;
135
+ functionName: string;
136
+ functionData: Record<string, any>;
137
+ }>;
138
+ }, "strip", z.ZodTypeAny, {
139
+ type: SAFETransactionType.FUNCTIONS;
140
+ action: "ADD" | "DELETE" | "UPDATE";
141
+ data: {
142
+ functionId: string;
143
+ functionName: string;
144
+ functionData: Record<string, any>;
145
+ };
146
+ }, {
147
+ type: SAFETransactionType.FUNCTIONS;
148
+ action: "ADD" | "DELETE" | "UPDATE";
149
+ data: {
150
+ functionId: string;
151
+ functionName: string;
152
+ functionData: Record<string, any>;
153
+ };
154
+ }>;
155
+ version: z.ZodNumber;
156
+ }>, {
157
+ transaction: z.ZodObject<{
158
+ action: z.ZodLiteral<SAFETransactionActionType.ADD>;
159
+ data: z.ZodObject<{
160
+ functionId: z.ZodString;
161
+ functionName: z.ZodString;
162
+ functionData: z.ZodRecord<z.ZodString, z.ZodAny>;
163
+ }, "strip", z.ZodTypeAny, {
164
+ functionId: string;
165
+ functionName: string;
166
+ functionData: Record<string, any>;
167
+ }, {
168
+ functionId: string;
169
+ functionName: string;
170
+ functionData: Record<string, any>;
171
+ }>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ action: SAFETransactionActionType.ADD;
174
+ data: {
175
+ functionId: string;
176
+ functionName: string;
177
+ functionData: Record<string, any>;
178
+ };
179
+ }, {
180
+ action: SAFETransactionActionType.ADD;
181
+ data: {
182
+ functionId: string;
183
+ functionName: string;
184
+ functionData: Record<string, any>;
185
+ };
186
+ }>;
187
+ }>, "strip", z.ZodTypeAny, {
188
+ createdAt: number;
189
+ version: number;
190
+ authority: string;
191
+ authoritySignature: string;
192
+ transaction: {
193
+ action: SAFETransactionActionType.ADD;
194
+ data: {
195
+ functionId: string;
196
+ functionName: string;
197
+ functionData: Record<string, any>;
198
+ };
199
+ };
200
+ }, {
201
+ createdAt: number;
202
+ version: number;
203
+ authority: string;
204
+ authoritySignature: string;
205
+ transaction: {
206
+ action: SAFETransactionActionType.ADD;
207
+ data: {
208
+ functionId: string;
209
+ functionName: string;
210
+ functionData: Record<string, any>;
211
+ };
212
+ };
213
+ }>;
214
+ export type ISAFETransactionFunctionAdd = z.infer<typeof ISAFETransactionFunctionAddSchema>;
215
+ /**
216
+ * This is the schema for the function transaction update.
217
+ */
218
+ export declare const ISAFETransactionFunctionUpdateSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
219
+ createdAt: z.ZodNumber;
220
+ authority: z.ZodString;
221
+ authoritySignature: z.ZodString;
222
+ transaction: z.ZodObject<{
223
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
224
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
227
+ action: "ADD" | "DELETE" | "UPDATE";
228
+ }, {
229
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
230
+ action: "ADD" | "DELETE" | "UPDATE";
231
+ }>;
232
+ version: z.ZodNumber;
233
+ }, {
234
+ transaction: z.ZodObject<{
235
+ type: z.ZodLiteral<SAFETransactionType.FUNCTIONS>;
236
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
237
+ data: z.ZodObject<{
238
+ functionId: z.ZodString;
239
+ functionName: z.ZodString;
240
+ functionData: z.ZodRecord<z.ZodString, z.ZodAny>;
241
+ }, "strip", z.ZodTypeAny, {
242
+ functionId: string;
243
+ functionName: string;
244
+ functionData: Record<string, any>;
245
+ }, {
246
+ functionId: string;
247
+ functionName: string;
248
+ functionData: Record<string, any>;
249
+ }>;
250
+ }, "strip", z.ZodTypeAny, {
251
+ type: SAFETransactionType.FUNCTIONS;
252
+ action: "ADD" | "DELETE" | "UPDATE";
253
+ data: {
254
+ functionId: string;
255
+ functionName: string;
256
+ functionData: Record<string, any>;
257
+ };
258
+ }, {
259
+ type: SAFETransactionType.FUNCTIONS;
260
+ action: "ADD" | "DELETE" | "UPDATE";
261
+ data: {
262
+ functionId: string;
263
+ functionName: string;
264
+ functionData: Record<string, any>;
265
+ };
266
+ }>;
267
+ version: z.ZodNumber;
268
+ }>, {
269
+ transaction: z.ZodObject<{
270
+ action: z.ZodLiteral<SAFETransactionActionType.UPDATE>;
271
+ data: z.ZodObject<{
272
+ functionId: z.ZodString;
273
+ functionName: z.ZodString;
274
+ functionData: z.ZodRecord<z.ZodString, z.ZodAny>;
275
+ }, "strip", z.ZodTypeAny, {
276
+ functionId: string;
277
+ functionName: string;
278
+ functionData: Record<string, any>;
279
+ }, {
280
+ functionId: string;
281
+ functionName: string;
282
+ functionData: Record<string, any>;
283
+ }>;
284
+ }, "strip", z.ZodTypeAny, {
285
+ action: SAFETransactionActionType.UPDATE;
286
+ data: {
287
+ functionId: string;
288
+ functionName: string;
289
+ functionData: Record<string, any>;
290
+ };
291
+ }, {
292
+ action: SAFETransactionActionType.UPDATE;
293
+ data: {
294
+ functionId: string;
295
+ functionName: string;
296
+ functionData: Record<string, any>;
297
+ };
298
+ }>;
299
+ }>, "strip", z.ZodTypeAny, {
300
+ createdAt: number;
301
+ version: number;
302
+ authority: string;
303
+ authoritySignature: string;
304
+ transaction: {
305
+ action: SAFETransactionActionType.UPDATE;
306
+ data: {
307
+ functionId: string;
308
+ functionName: string;
309
+ functionData: Record<string, any>;
310
+ };
311
+ };
312
+ }, {
313
+ createdAt: number;
314
+ version: number;
315
+ authority: string;
316
+ authoritySignature: string;
317
+ transaction: {
318
+ action: SAFETransactionActionType.UPDATE;
319
+ data: {
320
+ functionId: string;
321
+ functionName: string;
322
+ functionData: Record<string, any>;
323
+ };
324
+ };
325
+ }>;
326
+ export type ISAFETransactionFunctionUpdate = z.infer<typeof ISAFETransactionFunctionUpdateSchema>;
327
+ /**
328
+ * This is the schema for the function transaction delete.
329
+ */
330
+ export declare const ISAFETransactionFunctionDeleteSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
331
+ createdAt: z.ZodNumber;
332
+ authority: z.ZodString;
333
+ authoritySignature: z.ZodString;
334
+ transaction: z.ZodObject<{
335
+ type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
336
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
337
+ }, "strip", z.ZodTypeAny, {
338
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
339
+ action: "ADD" | "DELETE" | "UPDATE";
340
+ }, {
341
+ type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
342
+ action: "ADD" | "DELETE" | "UPDATE";
343
+ }>;
344
+ version: z.ZodNumber;
345
+ }, {
346
+ transaction: z.ZodObject<{
347
+ type: z.ZodLiteral<SAFETransactionType.FUNCTIONS>;
348
+ action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
349
+ data: z.ZodObject<{
350
+ functionId: z.ZodString;
351
+ functionName: z.ZodString;
352
+ functionData: z.ZodRecord<z.ZodString, z.ZodAny>;
353
+ }, "strip", z.ZodTypeAny, {
354
+ functionId: string;
355
+ functionName: string;
356
+ functionData: Record<string, any>;
357
+ }, {
358
+ functionId: string;
359
+ functionName: string;
360
+ functionData: Record<string, any>;
361
+ }>;
362
+ }, "strip", z.ZodTypeAny, {
363
+ type: SAFETransactionType.FUNCTIONS;
364
+ action: "ADD" | "DELETE" | "UPDATE";
365
+ data: {
366
+ functionId: string;
367
+ functionName: string;
368
+ functionData: Record<string, any>;
369
+ };
370
+ }, {
371
+ type: SAFETransactionType.FUNCTIONS;
372
+ action: "ADD" | "DELETE" | "UPDATE";
373
+ data: {
374
+ functionId: string;
375
+ functionName: string;
376
+ functionData: Record<string, any>;
377
+ };
378
+ }>;
379
+ version: z.ZodNumber;
380
+ }>, {
381
+ transaction: z.ZodObject<{
382
+ action: z.ZodLiteral<SAFETransactionActionType.DELETE>;
383
+ data: z.ZodObject<{
384
+ functionId: z.ZodString;
385
+ functionName: z.ZodString;
386
+ functionData: z.ZodRecord<z.ZodString, z.ZodAny>;
387
+ }, "strip", z.ZodTypeAny, {
388
+ functionId: string;
389
+ functionName: string;
390
+ functionData: Record<string, any>;
391
+ }, {
392
+ functionId: string;
393
+ functionName: string;
394
+ functionData: Record<string, any>;
395
+ }>;
396
+ }, "strip", z.ZodTypeAny, {
397
+ action: SAFETransactionActionType.DELETE;
398
+ data: {
399
+ functionId: string;
400
+ functionName: string;
401
+ functionData: Record<string, any>;
402
+ };
403
+ }, {
404
+ action: SAFETransactionActionType.DELETE;
405
+ data: {
406
+ functionId: string;
407
+ functionName: string;
408
+ functionData: Record<string, any>;
409
+ };
410
+ }>;
411
+ }>, "strip", z.ZodTypeAny, {
412
+ createdAt: number;
413
+ version: number;
414
+ authority: string;
415
+ authoritySignature: string;
416
+ transaction: {
417
+ action: SAFETransactionActionType.DELETE;
418
+ data: {
419
+ functionId: string;
420
+ functionName: string;
421
+ functionData: Record<string, any>;
422
+ };
423
+ };
424
+ }, {
425
+ createdAt: number;
426
+ version: number;
427
+ authority: string;
428
+ authoritySignature: string;
429
+ transaction: {
430
+ action: SAFETransactionActionType.DELETE;
431
+ data: {
432
+ functionId: string;
433
+ functionName: string;
434
+ functionData: Record<string, any>;
435
+ };
436
+ };
437
+ }>;
438
+ export type ISAFETransactionFunctionDelete = z.infer<typeof ISAFETransactionFunctionDeleteSchema>;
439
+ //# sourceMappingURL=functions-transactions-models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions-transactions-models.d.ts","sourceRoot":"","sources":["../../../../src/models/safe/transactions/functions-transactions-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,mBAAmB,EACnB,yBAAyB,EAG5B,MAAM,4BAA4B,CAAC;AAIpC;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;EAI7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAItF;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ISAFETransactionFunctionDeleteSchema = exports.ISAFETransactionFunctionUpdateSchema = exports.ISAFETransactionFunctionAddSchema = exports.ISAFETransactionFunctionSchema = exports.ISAFETransactionFunctionDataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const safe_transaction_models_1 = require("../safe-transaction-models");
6
+ //#region Functions Transaction
7
+ /**
8
+ * This is the data for the function in the SAFE Ecosystem.
9
+ */
10
+ exports.ISAFETransactionFunctionDataSchema = zod_1.z.object({
11
+ functionId: zod_1.z.string(),
12
+ functionName: zod_1.z.string(),
13
+ functionData: zod_1.z.record(zod_1.z.any()),
14
+ });
15
+ /**
16
+ * This is the transaction targeting a function in the SAFE Ecosystem.
17
+ */
18
+ exports.ISAFETransactionFunctionSchema = safe_transaction_models_1.ISAFETransactionBaseSchema.extend({
19
+ transaction: zod_1.z.object({
20
+ type: zod_1.z.literal(safe_transaction_models_1.SAFETransactionType.FUNCTIONS),
21
+ action: safe_transaction_models_1.SAFETransactionActionTypeSchema,
22
+ data: exports.ISAFETransactionFunctionDataSchema,
23
+ }),
24
+ version: zod_1.z.number().min(1),
25
+ });
26
+ //#endregion Functions Transaction
27
+ /**
28
+ * This is the schema for the function transaction add.
29
+ */
30
+ exports.ISAFETransactionFunctionAddSchema = exports.ISAFETransactionFunctionSchema.extend({
31
+ transaction: zod_1.z.object({
32
+ action: zod_1.z.literal(safe_transaction_models_1.SAFETransactionActionType.ADD),
33
+ data: exports.ISAFETransactionFunctionDataSchema,
34
+ }),
35
+ });
36
+ /**
37
+ * This is the schema for the function transaction update.
38
+ */
39
+ exports.ISAFETransactionFunctionUpdateSchema = exports.ISAFETransactionFunctionSchema.extend({
40
+ transaction: zod_1.z.object({
41
+ action: zod_1.z.literal(safe_transaction_models_1.SAFETransactionActionType.UPDATE),
42
+ data: exports.ISAFETransactionFunctionDataSchema,
43
+ }),
44
+ });
45
+ /**
46
+ * This is the schema for the function transaction delete.
47
+ */
48
+ exports.ISAFETransactionFunctionDeleteSchema = exports.ISAFETransactionFunctionSchema.extend({
49
+ transaction: zod_1.z.object({
50
+ action: zod_1.z.literal(safe_transaction_models_1.SAFETransactionActionType.DELETE),
51
+ data: exports.ISAFETransactionFunctionDataSchema,
52
+ }),
53
+ });