@degenerate/generic 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/models/index.d.ts +2 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +2 -1
- package/dist/models/rules/share-rule-models.d.ts +1528 -0
- package/dist/models/rules/share-rule-models.d.ts.map +1 -0
- package/dist/models/{safe/rules → rules}/share-rule-models.js +61 -5
- package/dist/models/safe/safe-transaction-models.d.ts +1 -127
- package/dist/models/safe/safe-transaction-models.d.ts.map +1 -1
- package/dist/models/safe/safe-transaction-models.js +4 -43
- package/dist/models/safe/transactions/authorities-transactions-models.d.ts +136 -9
- package/dist/models/safe/transactions/authorities-transactions-models.d.ts.map +1 -1
- package/dist/models/safe/transactions/authorities-transactions-models.js +48 -7
- package/dist/models/safe/transactions/rules-transactions-models.d.ts +628 -0
- package/dist/models/safe/transactions/rules-transactions-models.d.ts.map +1 -0
- package/dist/models/safe/transactions/rules-transactions-models.js +73 -0
- package/dist/models/share-data/share-data.d.ts +5 -1
- package/dist/models/share-data/share-data.d.ts.map +1 -1
- package/dist/models/share-data/share-data.js +0 -5
- package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts +2 -1
- package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts.map +1 -1
- package/dist/transactions/authority/create-safe-transaction-authority.d.ts +2 -1
- package/dist/transactions/authority/create-safe-transaction-authority.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/models/safe/rules/share-rule-models.d.ts +0 -931
- package/dist/models/safe/rules/share-rule-models.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-rule-models.d.ts","sourceRoot":"","sources":["../../../src/models/rules/share-rule-models.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB;;GAEG;AAIH;;GAEG;AACH,oBAAY,eAAe;IACvB,GAAG,QAAQ;IACX,EAA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AAC;AAEH,MAAM,WAAW,aAAa;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -3,8 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.IShareRuleSetSchema = exports.IShareRuleGroupSchema = exports.IRuleEvaluationResultsSchema = exports.IShareRulesEvaluationResultSchema = exports.IShareRuleEvalutionResultSchema = exports.IShareRuleAppliedSchema = exports.IShareRuleSchema = exports.IConditionSpecialSchema = exports.IConditionEmptySchema = exports.IConditionBooleanSchema = exports.IConditionNullSchema = exports.IConditionStartsEndsWithSchema = exports.IConditionContainsSchema = exports.IConditionRangeSchema = exports.IConditionEqualitySchema = exports.IConditionTypeOfSchema = exports.IConditionBaseSchema = exports.ConditionTypeOfSchema = exports.ConditionTypeOf = exports.ConditionTypeSchema = exports.ConditionTypeSpecialSchema = exports.ConditionTypeSpecial = exports.ConditionTypeBooleanSchema = exports.ConditionTypeBoolean = exports.ConditionTypeStartsEndsWithSchema = exports.ConditionTypeStartsEndsWith = exports.ConditionTypeRangeSchema = exports.ConditionTypeRange = exports.ConditionTypeSingleSchema = exports.ConditionTypeSingle = exports.ConditionTypeQualifierSchema = exports.ConditionTypeQualifier = exports.LogicalOperatorSchema = exports.LogicalOperator = void 0;
|
|
6
|
+
exports.IShareRuleSetSchema = exports.IShareRuleGroupSchema = exports.IRuleEvaluationResultsSchema = exports.IShareRulesEvaluationResultSchema = exports.IShareRuleEvalutionResultSchema = exports.IShareRuleAppliedSchema = exports.IShareRuleSchema = exports.IConditionSchema = exports.IConditionShareRuleSchema = exports.IConditionSpecialSchema = exports.IConditionEmptySchema = exports.IConditionBooleanSchema = exports.IConditionNullSchema = exports.IConditionStartsEndsWithSchema = exports.IConditionContainsSchema = exports.IConditionRangeSchema = exports.IConditionEqualitySchema = exports.IConditionTypeOfSchema = exports.IConditionBaseSchema = exports.ConditionTypeOfSchema = exports.ConditionTypeOf = exports.ConditionTypeSchema = exports.ConditionTypeSpecialSchema = exports.ConditionTypeSpecial = exports.ConditionTypeBooleanSchema = exports.ConditionTypeBoolean = exports.ConditionTypeStartsEndsWithSchema = exports.ConditionTypeStartsEndsWith = exports.ConditionTypeRangeSchema = exports.ConditionTypeRange = exports.ConditionTypeSingleSchema = exports.ConditionTypeSingle = exports.ConditionTypeQualifierSchema = exports.ConditionTypeQualifier = exports.LogicalOperatorSchema = exports.LogicalOperator = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
// This file doesn't use the full zod protocalls because of the recursive nature
|
|
9
|
+
// of the share data conditions. The interfaces are duplicated in the share data
|
|
10
|
+
// conditions to allow for the recursive nature of the share data conditions.
|
|
8
11
|
/**
|
|
9
12
|
* This file contains the models for the rules used in the share data.
|
|
10
13
|
*/
|
|
@@ -187,7 +190,7 @@ const exampleConditionRange: IConditionRange = {
|
|
|
187
190
|
};
|
|
188
191
|
*/
|
|
189
192
|
exports.IConditionRangeSchema = exports.IConditionBaseSchema.extend({
|
|
190
|
-
conditionType:
|
|
193
|
+
conditionType: exports.ConditionTypeRangeSchema,
|
|
191
194
|
conditionValue: zod_1.default.union([zod_1.default.number(), zod_1.default.string()]),
|
|
192
195
|
});
|
|
193
196
|
/**
|
|
@@ -264,9 +267,62 @@ const exampleConditionSpecial: IConditionSpecial = {
|
|
|
264
267
|
};
|
|
265
268
|
*/
|
|
266
269
|
exports.IConditionSpecialSchema = exports.IConditionBaseSchema.extend({
|
|
267
|
-
conditionType:
|
|
270
|
+
conditionType: exports.ConditionTypeSpecialSchema,
|
|
268
271
|
conditionValue: zod_1.default.string(),
|
|
269
272
|
});
|
|
273
|
+
/**
|
|
274
|
+
* This is the interface for the share rule condition.
|
|
275
|
+
*
|
|
276
|
+
|
|
277
|
+
const nestedShareRule: IShareRule = {
|
|
278
|
+
ruleId: 'nestedRule',
|
|
279
|
+
currentDataConditions: [
|
|
280
|
+
{
|
|
281
|
+
targettedProperty: 'nestedProperty',
|
|
282
|
+
conditionType: 'EQUAL',
|
|
283
|
+
conditionValue: 'expectedValue',
|
|
284
|
+
conditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
proposedDataConditions: [
|
|
288
|
+
{
|
|
289
|
+
targettedProperty: 'nestedProperty',
|
|
290
|
+
conditionType: 'EQUAL',
|
|
291
|
+
conditionValue: 'newValue',
|
|
292
|
+
conditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
const conditionWithShareRule: IConditionShareRule = {
|
|
298
|
+
conditionType: ConditionTypeSingle.SHARE_RULE,
|
|
299
|
+
conditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
300
|
+
targettedProperty: 'parentProperty',
|
|
301
|
+
rule: nestedShareRule,
|
|
302
|
+
};
|
|
303
|
+
*/
|
|
304
|
+
// // Define the base schema for IConditionShareRuleSchema
|
|
305
|
+
const BaseConditionShareRuleSchema = zod_1.default.object({
|
|
306
|
+
conditionType: zod_1.default.literal(exports.ConditionTypeSingleSchema.Enum.SHARE_RULE),
|
|
307
|
+
conditionValue: zod_1.default.lazy(() => exports.IShareRuleSchema),
|
|
308
|
+
});
|
|
309
|
+
// Define the recursive schema using z.lazy
|
|
310
|
+
exports.IConditionShareRuleSchema = BaseConditionShareRuleSchema;
|
|
311
|
+
/**
|
|
312
|
+
* This is the interface for the conditional information in the checks.
|
|
313
|
+
*/
|
|
314
|
+
exports.IConditionSchema = zod_1.default.union([
|
|
315
|
+
exports.IConditionTypeOfSchema,
|
|
316
|
+
exports.IConditionEqualitySchema,
|
|
317
|
+
exports.IConditionRangeSchema,
|
|
318
|
+
exports.IConditionContainsSchema,
|
|
319
|
+
exports.IConditionStartsEndsWithSchema,
|
|
320
|
+
exports.IConditionNullSchema,
|
|
321
|
+
exports.IConditionBooleanSchema,
|
|
322
|
+
exports.IConditionEmptySchema,
|
|
323
|
+
exports.IConditionSpecialSchema,
|
|
324
|
+
exports.IConditionShareRuleSchema,
|
|
325
|
+
]);
|
|
270
326
|
//#endregion Conditions
|
|
271
327
|
//#region Rule
|
|
272
328
|
/**
|
|
@@ -274,8 +330,8 @@ exports.IConditionSpecialSchema = exports.IConditionBaseSchema.extend({
|
|
|
274
330
|
*/
|
|
275
331
|
exports.IShareRuleSchema = zod_1.default.object({
|
|
276
332
|
ruleId: zod_1.default.string(),
|
|
277
|
-
currentDataConditions: zod_1.default.array(exports.
|
|
278
|
-
proposedDataConditions: zod_1.default.array(exports.
|
|
333
|
+
currentDataConditions: zod_1.default.array(exports.IConditionSchema),
|
|
334
|
+
proposedDataConditions: zod_1.default.array(exports.IConditionSchema),
|
|
279
335
|
});
|
|
280
336
|
/**
|
|
281
337
|
* This contains the applied rule informaiton in the share data object.
|
|
@@ -4,7 +4,7 @@ import z from 'zod';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare enum SAFETransactionActionType {
|
|
6
6
|
ADD = "ADD",
|
|
7
|
-
|
|
7
|
+
DELETE = "DELETE",
|
|
8
8
|
UPDATE = "UPDATE"
|
|
9
9
|
}
|
|
10
10
|
export declare const SAFETransactionActionTypeSchema: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
|
|
@@ -69,130 +69,4 @@ export declare const ISAFETransactionBaseSchema: z.ZodObject<{
|
|
|
69
69
|
};
|
|
70
70
|
}>;
|
|
71
71
|
export type ISAFETransactionBase = z.infer<typeof ISAFETransactionBaseSchema>;
|
|
72
|
-
/**
|
|
73
|
-
* This is the data for the authority in the SAFE Ecosystem.
|
|
74
|
-
*/
|
|
75
|
-
export declare const ISAFETransactionAuthorityDataSchema: z.ZodObject<{
|
|
76
|
-
authorizationIssuer: z.ZodString;
|
|
77
|
-
authorizationPublicKey: z.ZodString;
|
|
78
|
-
authorityValidationType: z.ZodEnum<["JWT"]>;
|
|
79
|
-
authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
|
|
80
|
-
}, "strip", z.ZodTypeAny, {
|
|
81
|
-
authorizationIssuer: string;
|
|
82
|
-
authorizationPublicKey: string;
|
|
83
|
-
authorityValidationType: "JWT";
|
|
84
|
-
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
85
|
-
}, {
|
|
86
|
-
authorizationIssuer: string;
|
|
87
|
-
authorizationPublicKey: string;
|
|
88
|
-
authorityValidationType: "JWT";
|
|
89
|
-
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
90
|
-
}>;
|
|
91
|
-
export type ISAFETransactionAuthorityData = z.infer<typeof ISAFETransactionAuthorityDataSchema>;
|
|
92
|
-
/**
|
|
93
|
-
* This is the transaction targetting an authority in the SAFE Ecosystem.
|
|
94
|
-
*
|
|
95
|
-
const sampleTransactionAuthority: ISAFETransactionAuthority = {
|
|
96
|
-
createdAt: Date.now(),
|
|
97
|
-
authority: '0xAuthorityPublicKey',
|
|
98
|
-
authoritySignature: '0xAuthoritySignature',
|
|
99
|
-
transaction: {
|
|
100
|
-
type: SAFETransactionType.AUTHORITY,
|
|
101
|
-
action: SAFETransactionActionType.CREATE,
|
|
102
|
-
data: {
|
|
103
|
-
authorizationIssuer: 'exampleIssuer-12345678' as AuthorizationIssuer,
|
|
104
|
-
authorizationPublicKey: '0xAuthorizationPublicKey',
|
|
105
|
-
authorityValidationType: AuthorityValidationType.JWT,
|
|
106
|
-
authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
version: 1,
|
|
110
|
-
};
|
|
111
|
-
*/
|
|
112
|
-
export declare const ISAFETransactionAuthoritySchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
113
|
-
createdAt: z.ZodNumber;
|
|
114
|
-
authority: z.ZodString;
|
|
115
|
-
authoritySignature: z.ZodString;
|
|
116
|
-
transaction: z.ZodObject<{
|
|
117
|
-
type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
|
|
118
|
-
action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
|
|
119
|
-
}, "strip", z.ZodTypeAny, {
|
|
120
|
-
type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
|
|
121
|
-
action: "ADD" | "DELETE" | "UPDATE";
|
|
122
|
-
}, {
|
|
123
|
-
type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
|
|
124
|
-
action: "ADD" | "DELETE" | "UPDATE";
|
|
125
|
-
}>;
|
|
126
|
-
version: z.ZodNumber;
|
|
127
|
-
}, {
|
|
128
|
-
transaction: z.ZodObject<{
|
|
129
|
-
type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
|
|
130
|
-
action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
|
|
131
|
-
data: z.ZodObject<{
|
|
132
|
-
authorizationIssuer: z.ZodString;
|
|
133
|
-
authorizationPublicKey: z.ZodString;
|
|
134
|
-
authorityValidationType: z.ZodEnum<["JWT"]>;
|
|
135
|
-
authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
|
|
136
|
-
}, "strip", z.ZodTypeAny, {
|
|
137
|
-
authorizationIssuer: string;
|
|
138
|
-
authorizationPublicKey: string;
|
|
139
|
-
authorityValidationType: "JWT";
|
|
140
|
-
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
141
|
-
}, {
|
|
142
|
-
authorizationIssuer: string;
|
|
143
|
-
authorizationPublicKey: string;
|
|
144
|
-
authorityValidationType: "JWT";
|
|
145
|
-
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
146
|
-
}>;
|
|
147
|
-
}, "strip", z.ZodTypeAny, {
|
|
148
|
-
type: SAFETransactionType.AUTHORITY;
|
|
149
|
-
action: "ADD" | "DELETE" | "UPDATE";
|
|
150
|
-
data: {
|
|
151
|
-
authorizationIssuer: string;
|
|
152
|
-
authorizationPublicKey: string;
|
|
153
|
-
authorityValidationType: "JWT";
|
|
154
|
-
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
155
|
-
};
|
|
156
|
-
}, {
|
|
157
|
-
type: SAFETransactionType.AUTHORITY;
|
|
158
|
-
action: "ADD" | "DELETE" | "UPDATE";
|
|
159
|
-
data: {
|
|
160
|
-
authorizationIssuer: string;
|
|
161
|
-
authorizationPublicKey: string;
|
|
162
|
-
authorityValidationType: "JWT";
|
|
163
|
-
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
164
|
-
};
|
|
165
|
-
}>;
|
|
166
|
-
}>, "strip", z.ZodTypeAny, {
|
|
167
|
-
createdAt: number;
|
|
168
|
-
version: number;
|
|
169
|
-
authority: string;
|
|
170
|
-
authoritySignature: string;
|
|
171
|
-
transaction: {
|
|
172
|
-
type: SAFETransactionType.AUTHORITY;
|
|
173
|
-
action: "ADD" | "DELETE" | "UPDATE";
|
|
174
|
-
data: {
|
|
175
|
-
authorizationIssuer: string;
|
|
176
|
-
authorizationPublicKey: string;
|
|
177
|
-
authorityValidationType: "JWT";
|
|
178
|
-
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
}, {
|
|
182
|
-
createdAt: number;
|
|
183
|
-
version: number;
|
|
184
|
-
authority: string;
|
|
185
|
-
authoritySignature: string;
|
|
186
|
-
transaction: {
|
|
187
|
-
type: SAFETransactionType.AUTHORITY;
|
|
188
|
-
action: "ADD" | "DELETE" | "UPDATE";
|
|
189
|
-
data: {
|
|
190
|
-
authorizationIssuer: string;
|
|
191
|
-
authorizationPublicKey: string;
|
|
192
|
-
authorityValidationType: "JWT";
|
|
193
|
-
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
}>;
|
|
197
|
-
export type ISAFETransactionAuthority = z.infer<typeof ISAFETransactionAuthoritySchema>;
|
|
198
72
|
//# sourceMappingURL=safe-transaction-models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-transaction-models.d.ts","sourceRoot":"","sources":["../../../src/models/safe/safe-transaction-models.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAUpB;;GAEG;AACH,oBAAY,yBAAyB;IACjC,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;CACpB;AAED,eAAO,MAAM,+BAA+B,wCAI1C,CAAC;AAEH;;GAEG;AACH,oBAAY,mBAAmB;IAC3B,SAAS,cAAc,CAAE,sCAAsC;IAC/D,SAAS,cAAc,CAAE,uCAAuC;IAChE,SAAS,cAAc,CAAE,sCAAsC;IAC/D,KAAK,UAAU,CAAE,kCAAkC;IACnD,MAAM,WAAW,CAAE,mCAAmC;IACtD,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,yBAAyB,oFAOpC,CAAC;AAMH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC
|
|
1
|
+
{"version":3,"file":"safe-transaction-models.d.ts","sourceRoot":"","sources":["../../../src/models/safe/safe-transaction-models.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAUpB;;GAEG;AACH,oBAAY,yBAAyB;IACjC,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,MAAM,WAAW;CACpB;AAED,eAAO,MAAM,+BAA+B,wCAI1C,CAAC;AAEH;;GAEG;AACH,oBAAY,mBAAmB;IAC3B,SAAS,cAAc,CAAE,sCAAsC;IAC/D,SAAS,cAAc,CAAE,uCAAuC;IAChE,SAAS,cAAc,CAAE,sCAAsC;IAC/D,KAAK,UAAU,CAAE,kCAAkC;IACnD,MAAM,WAAW,CAAE,mCAAmC;IACtD,SAAS,cAAc;CAC1B;AAED,eAAO,MAAM,yBAAyB,oFAOpC,CAAC;AAMH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -3,9 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.ISAFETransactionBaseSchema = exports.SAFETransactionTypeSchema = exports.SAFETransactionType = exports.SAFETransactionActionTypeSchema = exports.SAFETransactionActionType = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
|
-
const authorization_models_1 = require("../authorization/authorization-models");
|
|
9
8
|
/// This file is used to keep all safe transactions for the SAFE system.
|
|
10
9
|
//#region Enums
|
|
11
10
|
/**
|
|
@@ -14,7 +13,7 @@ const authorization_models_1 = require("../authorization/authorization-models");
|
|
|
14
13
|
var SAFETransactionActionType;
|
|
15
14
|
(function (SAFETransactionActionType) {
|
|
16
15
|
SAFETransactionActionType["ADD"] = "ADD";
|
|
17
|
-
SAFETransactionActionType["
|
|
16
|
+
SAFETransactionActionType["DELETE"] = "DELETE";
|
|
18
17
|
SAFETransactionActionType["UPDATE"] = "UPDATE";
|
|
19
18
|
})(SAFETransactionActionType || (exports.SAFETransactionActionType = SAFETransactionActionType = {}));
|
|
20
19
|
exports.SAFETransactionActionTypeSchema = zod_1.default.enum([
|
|
@@ -69,43 +68,5 @@ exports.ISAFETransactionBaseSchema = zod_1.default.object({
|
|
|
69
68
|
version: zod_1.default.number(), // the version of the transaction
|
|
70
69
|
});
|
|
71
70
|
//#endregion Base Transaction
|
|
72
|
-
//#region
|
|
73
|
-
|
|
74
|
-
// const AuthorityValidationTypeSchema = z.enum(['JWT']);
|
|
75
|
-
/**
|
|
76
|
-
* This is the data for the authority in the SAFE Ecosystem.
|
|
77
|
-
*/
|
|
78
|
-
exports.ISAFETransactionAuthorityDataSchema = zod_1.default.object({
|
|
79
|
-
authorizationIssuer: authorization_models_1.AuthorizationIssuerSchema,
|
|
80
|
-
authorizationPublicKey: zod_1.default.string(),
|
|
81
|
-
authorityValidationType: authorization_models_1.AuthorityValidationTypeSchema,
|
|
82
|
-
authorityOver: zod_1.default.array(exports.SAFETransactionTypeSchema),
|
|
83
|
-
});
|
|
84
|
-
/**
|
|
85
|
-
* This is the transaction targetting an authority in the SAFE Ecosystem.
|
|
86
|
-
*
|
|
87
|
-
const sampleTransactionAuthority: ISAFETransactionAuthority = {
|
|
88
|
-
createdAt: Date.now(),
|
|
89
|
-
authority: '0xAuthorityPublicKey',
|
|
90
|
-
authoritySignature: '0xAuthoritySignature',
|
|
91
|
-
transaction: {
|
|
92
|
-
type: SAFETransactionType.AUTHORITY,
|
|
93
|
-
action: SAFETransactionActionType.CREATE,
|
|
94
|
-
data: {
|
|
95
|
-
authorizationIssuer: 'exampleIssuer-12345678' as AuthorizationIssuer,
|
|
96
|
-
authorizationPublicKey: '0xAuthorizationPublicKey',
|
|
97
|
-
authorityValidationType: AuthorityValidationType.JWT,
|
|
98
|
-
authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
version: 1,
|
|
102
|
-
};
|
|
103
|
-
*/
|
|
104
|
-
exports.ISAFETransactionAuthoritySchema = exports.ISAFETransactionBaseSchema.extend({
|
|
105
|
-
transaction: zod_1.default.object({
|
|
106
|
-
type: zod_1.default.literal(SAFETransactionType.AUTHORITY),
|
|
107
|
-
action: exports.SAFETransactionActionTypeSchema,
|
|
108
|
-
data: exports.ISAFETransactionAuthorityDataSchema,
|
|
109
|
-
}),
|
|
110
|
-
});
|
|
111
|
-
//#endregion Authorities Transaction
|
|
71
|
+
//#region Share Rules Transaction
|
|
72
|
+
//#endregion Share Rules Transaction
|
|
@@ -1,4 +1,131 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
+
import { SAFETransactionType } from '../safe-transaction-models';
|
|
3
|
+
/**
|
|
4
|
+
* This is the data for the authority in the SAFE Ecosystem.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ISAFETransactionAuthorityDataSchema: z.ZodObject<{
|
|
7
|
+
authorizationIssuer: z.ZodString;
|
|
8
|
+
authorizationPublicKey: z.ZodString;
|
|
9
|
+
authorityValidationType: z.ZodEnum<["JWT"]>;
|
|
10
|
+
authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
authorizationIssuer: string;
|
|
13
|
+
authorizationPublicKey: string;
|
|
14
|
+
authorityValidationType: "JWT";
|
|
15
|
+
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
16
|
+
}, {
|
|
17
|
+
authorizationIssuer: string;
|
|
18
|
+
authorizationPublicKey: string;
|
|
19
|
+
authorityValidationType: "JWT";
|
|
20
|
+
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
21
|
+
}>;
|
|
22
|
+
export type ISAFETransactionAuthorityData = z.infer<typeof ISAFETransactionAuthorityDataSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* This is the transaction targetting an authority in the SAFE Ecosystem.
|
|
25
|
+
*
|
|
26
|
+
const sampleTransactionAuthority: ISAFETransactionAuthority = {
|
|
27
|
+
createdAt: Date.now(),
|
|
28
|
+
authority: '0xAuthorityPublicKey',
|
|
29
|
+
authoritySignature: '0xAuthoritySignature',
|
|
30
|
+
transaction: {
|
|
31
|
+
type: SAFETransactionType.AUTHORITY,
|
|
32
|
+
action: SAFETransactionActionType.CREATE,
|
|
33
|
+
data: {
|
|
34
|
+
authorizationIssuer: 'exampleIssuer-12345678' as AuthorizationIssuer,
|
|
35
|
+
authorizationPublicKey: '0xAuthorizationPublicKey',
|
|
36
|
+
authorityValidationType: AuthorityValidationType.JWT,
|
|
37
|
+
authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
version: 1,
|
|
41
|
+
};
|
|
42
|
+
*/
|
|
43
|
+
export declare const ISAFETransactionAuthoritySchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
44
|
+
createdAt: z.ZodNumber;
|
|
45
|
+
authority: z.ZodString;
|
|
46
|
+
authoritySignature: z.ZodString;
|
|
47
|
+
transaction: z.ZodObject<{
|
|
48
|
+
type: z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>;
|
|
49
|
+
action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
|
|
52
|
+
action: "ADD" | "DELETE" | "UPDATE";
|
|
53
|
+
}, {
|
|
54
|
+
type: "SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY";
|
|
55
|
+
action: "ADD" | "DELETE" | "UPDATE";
|
|
56
|
+
}>;
|
|
57
|
+
version: z.ZodNumber;
|
|
58
|
+
}, {
|
|
59
|
+
transaction: z.ZodObject<{
|
|
60
|
+
type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
|
|
61
|
+
action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
|
|
62
|
+
data: z.ZodObject<{
|
|
63
|
+
authorizationIssuer: z.ZodString;
|
|
64
|
+
authorizationPublicKey: z.ZodString;
|
|
65
|
+
authorityValidationType: z.ZodEnum<["JWT"]>;
|
|
66
|
+
authorityOver: z.ZodArray<z.ZodEnum<["AUTHORITY", "SHAREDATA", "FUNCTIONS", "RULES", "EVENTS", "ENDPOINTS"]>, "many">;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
authorizationIssuer: string;
|
|
69
|
+
authorizationPublicKey: string;
|
|
70
|
+
authorityValidationType: "JWT";
|
|
71
|
+
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
72
|
+
}, {
|
|
73
|
+
authorizationIssuer: string;
|
|
74
|
+
authorizationPublicKey: string;
|
|
75
|
+
authorityValidationType: "JWT";
|
|
76
|
+
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
77
|
+
}>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
type: SAFETransactionType.AUTHORITY;
|
|
80
|
+
action: "ADD" | "DELETE" | "UPDATE";
|
|
81
|
+
data: {
|
|
82
|
+
authorizationIssuer: string;
|
|
83
|
+
authorizationPublicKey: string;
|
|
84
|
+
authorityValidationType: "JWT";
|
|
85
|
+
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
86
|
+
};
|
|
87
|
+
}, {
|
|
88
|
+
type: SAFETransactionType.AUTHORITY;
|
|
89
|
+
action: "ADD" | "DELETE" | "UPDATE";
|
|
90
|
+
data: {
|
|
91
|
+
authorizationIssuer: string;
|
|
92
|
+
authorizationPublicKey: string;
|
|
93
|
+
authorityValidationType: "JWT";
|
|
94
|
+
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
95
|
+
};
|
|
96
|
+
}>;
|
|
97
|
+
}>, "strip", z.ZodTypeAny, {
|
|
98
|
+
createdAt: number;
|
|
99
|
+
version: number;
|
|
100
|
+
authority: string;
|
|
101
|
+
authoritySignature: string;
|
|
102
|
+
transaction: {
|
|
103
|
+
type: SAFETransactionType.AUTHORITY;
|
|
104
|
+
action: "ADD" | "DELETE" | "UPDATE";
|
|
105
|
+
data: {
|
|
106
|
+
authorizationIssuer: string;
|
|
107
|
+
authorizationPublicKey: string;
|
|
108
|
+
authorityValidationType: "JWT";
|
|
109
|
+
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
}, {
|
|
113
|
+
createdAt: number;
|
|
114
|
+
version: number;
|
|
115
|
+
authority: string;
|
|
116
|
+
authoritySignature: string;
|
|
117
|
+
transaction: {
|
|
118
|
+
type: SAFETransactionType.AUTHORITY;
|
|
119
|
+
action: "ADD" | "DELETE" | "UPDATE";
|
|
120
|
+
data: {
|
|
121
|
+
authorizationIssuer: string;
|
|
122
|
+
authorizationPublicKey: string;
|
|
123
|
+
authorityValidationType: "JWT";
|
|
124
|
+
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
}>;
|
|
128
|
+
export type ISAFETransactionAuthority = z.infer<typeof ISAFETransactionAuthoritySchema>;
|
|
2
129
|
/**
|
|
3
130
|
* This is the transaction targetting an authority in the SAFE Ecosystem.
|
|
4
131
|
*
|
|
@@ -39,7 +166,7 @@ export declare const ISAFETransactionAuthorityAddSchema: z.ZodObject<z.objectUti
|
|
|
39
166
|
version: z.ZodNumber;
|
|
40
167
|
}, {
|
|
41
168
|
transaction: z.ZodObject<{
|
|
42
|
-
type: z.ZodLiteral<
|
|
169
|
+
type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
|
|
43
170
|
action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
|
|
44
171
|
data: z.ZodObject<{
|
|
45
172
|
authorizationIssuer: z.ZodString;
|
|
@@ -58,7 +185,7 @@ export declare const ISAFETransactionAuthorityAddSchema: z.ZodObject<z.objectUti
|
|
|
58
185
|
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
59
186
|
}>;
|
|
60
187
|
}, "strip", z.ZodTypeAny, {
|
|
61
|
-
type:
|
|
188
|
+
type: SAFETransactionType.AUTHORITY;
|
|
62
189
|
action: "ADD" | "DELETE" | "UPDATE";
|
|
63
190
|
data: {
|
|
64
191
|
authorizationIssuer: string;
|
|
@@ -67,7 +194,7 @@ export declare const ISAFETransactionAuthorityAddSchema: z.ZodObject<z.objectUti
|
|
|
67
194
|
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
68
195
|
};
|
|
69
196
|
}, {
|
|
70
|
-
type:
|
|
197
|
+
type: SAFETransactionType.AUTHORITY;
|
|
71
198
|
action: "ADD" | "DELETE" | "UPDATE";
|
|
72
199
|
data: {
|
|
73
200
|
authorizationIssuer: string;
|
|
@@ -162,7 +289,7 @@ export declare const ISAFETransactionAuthorityUpdateSchema: z.ZodObject<z.object
|
|
|
162
289
|
version: z.ZodNumber;
|
|
163
290
|
}, {
|
|
164
291
|
transaction: z.ZodObject<{
|
|
165
|
-
type: z.ZodLiteral<
|
|
292
|
+
type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
|
|
166
293
|
action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
|
|
167
294
|
data: z.ZodObject<{
|
|
168
295
|
authorizationIssuer: z.ZodString;
|
|
@@ -181,7 +308,7 @@ export declare const ISAFETransactionAuthorityUpdateSchema: z.ZodObject<z.object
|
|
|
181
308
|
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
182
309
|
}>;
|
|
183
310
|
}, "strip", z.ZodTypeAny, {
|
|
184
|
-
type:
|
|
311
|
+
type: SAFETransactionType.AUTHORITY;
|
|
185
312
|
action: "ADD" | "DELETE" | "UPDATE";
|
|
186
313
|
data: {
|
|
187
314
|
authorizationIssuer: string;
|
|
@@ -190,7 +317,7 @@ export declare const ISAFETransactionAuthorityUpdateSchema: z.ZodObject<z.object
|
|
|
190
317
|
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
191
318
|
};
|
|
192
319
|
}, {
|
|
193
|
-
type:
|
|
320
|
+
type: SAFETransactionType.AUTHORITY;
|
|
194
321
|
action: "ADD" | "DELETE" | "UPDATE";
|
|
195
322
|
data: {
|
|
196
323
|
authorizationIssuer: string;
|
|
@@ -285,7 +412,7 @@ export declare const ISAFETransactionAuthorityDeleteSchema: z.ZodObject<z.object
|
|
|
285
412
|
version: z.ZodNumber;
|
|
286
413
|
}, {
|
|
287
414
|
transaction: z.ZodObject<{
|
|
288
|
-
type: z.ZodLiteral<
|
|
415
|
+
type: z.ZodLiteral<SAFETransactionType.AUTHORITY>;
|
|
289
416
|
action: z.ZodEnum<["ADD", "DELETE", "UPDATE"]>;
|
|
290
417
|
data: z.ZodObject<{
|
|
291
418
|
authorizationIssuer: z.ZodString;
|
|
@@ -304,7 +431,7 @@ export declare const ISAFETransactionAuthorityDeleteSchema: z.ZodObject<z.object
|
|
|
304
431
|
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
305
432
|
}>;
|
|
306
433
|
}, "strip", z.ZodTypeAny, {
|
|
307
|
-
type:
|
|
434
|
+
type: SAFETransactionType.AUTHORITY;
|
|
308
435
|
action: "ADD" | "DELETE" | "UPDATE";
|
|
309
436
|
data: {
|
|
310
437
|
authorizationIssuer: string;
|
|
@@ -313,7 +440,7 @@ export declare const ISAFETransactionAuthorityDeleteSchema: z.ZodObject<z.object
|
|
|
313
440
|
authorityOver: ("SHAREDATA" | "FUNCTIONS" | "RULES" | "EVENTS" | "ENDPOINTS" | "AUTHORITY")[];
|
|
314
441
|
};
|
|
315
442
|
}, {
|
|
316
|
-
type:
|
|
443
|
+
type: SAFETransactionType.AUTHORITY;
|
|
317
444
|
action: "ADD" | "DELETE" | "UPDATE";
|
|
318
445
|
data: {
|
|
319
446
|
authorizationIssuer: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorities-transactions-models.d.ts","sourceRoot":"","sources":["../../../../src/models/safe/transactions/authorities-transactions-models.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"authorities-transactions-models.d.ts","sourceRoot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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC"}
|
|
@@ -3,10 +3,51 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ISAFETransactionAuthorityDeleteSchema = exports.ISAFETransactionAuthorityUpdateSchema = exports.ISAFETransactionAuthorityAddSchema = void 0;
|
|
6
|
+
exports.ISAFETransactionAuthorityDeleteSchema = exports.ISAFETransactionAuthorityUpdateSchema = exports.ISAFETransactionAuthorityAddSchema = exports.ISAFETransactionAuthoritySchema = exports.ISAFETransactionAuthorityDataSchema = void 0;
|
|
7
7
|
// This contains the schemas for the authorities transaction models
|
|
8
8
|
const zod_1 = __importDefault(require("zod"));
|
|
9
|
+
const authorization_models_1 = require("../../authorization/authorization-models");
|
|
9
10
|
const safe_transaction_models_1 = require("../safe-transaction-models");
|
|
11
|
+
//#region Authorities Transaction
|
|
12
|
+
// const AuthorizationIssuerSchema = z.string().regex(/^[a-zA-Z0-9]+-[a-zA-Z0-9]+$/);
|
|
13
|
+
// const AuthorityValidationTypeSchema = z.enum(['JWT']);
|
|
14
|
+
/**
|
|
15
|
+
* This is the data for the authority in the SAFE Ecosystem.
|
|
16
|
+
*/
|
|
17
|
+
exports.ISAFETransactionAuthorityDataSchema = zod_1.default.object({
|
|
18
|
+
authorizationIssuer: authorization_models_1.AuthorizationIssuerSchema,
|
|
19
|
+
authorizationPublicKey: zod_1.default.string(),
|
|
20
|
+
authorityValidationType: authorization_models_1.AuthorityValidationTypeSchema,
|
|
21
|
+
authorityOver: zod_1.default.array(safe_transaction_models_1.SAFETransactionTypeSchema),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* This is the transaction targetting an authority in the SAFE Ecosystem.
|
|
25
|
+
*
|
|
26
|
+
const sampleTransactionAuthority: ISAFETransactionAuthority = {
|
|
27
|
+
createdAt: Date.now(),
|
|
28
|
+
authority: '0xAuthorityPublicKey',
|
|
29
|
+
authoritySignature: '0xAuthoritySignature',
|
|
30
|
+
transaction: {
|
|
31
|
+
type: SAFETransactionType.AUTHORITY,
|
|
32
|
+
action: SAFETransactionActionType.CREATE,
|
|
33
|
+
data: {
|
|
34
|
+
authorizationIssuer: 'exampleIssuer-12345678' as AuthorizationIssuer,
|
|
35
|
+
authorizationPublicKey: '0xAuthorizationPublicKey',
|
|
36
|
+
authorityValidationType: AuthorityValidationType.JWT,
|
|
37
|
+
authorityOver: [SAFETransactionType.SHAREDATA, SAFETransactionType.FUNCTIONS],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
version: 1,
|
|
41
|
+
};
|
|
42
|
+
*/
|
|
43
|
+
exports.ISAFETransactionAuthoritySchema = safe_transaction_models_1.ISAFETransactionBaseSchema.extend({
|
|
44
|
+
transaction: zod_1.default.object({
|
|
45
|
+
type: zod_1.default.literal(safe_transaction_models_1.SAFETransactionType.AUTHORITY),
|
|
46
|
+
action: safe_transaction_models_1.SAFETransactionActionTypeSchema,
|
|
47
|
+
data: exports.ISAFETransactionAuthorityDataSchema,
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
//#endregion Authorities Transaction
|
|
10
51
|
/**
|
|
11
52
|
* This is the transaction targetting an authority in the SAFE Ecosystem.
|
|
12
53
|
*
|
|
@@ -30,27 +71,27 @@ const sampleTransactionAuthority: ISAFETransactionAuthority = {
|
|
|
30
71
|
/**
|
|
31
72
|
* This is the schema for the authority transaction add.
|
|
32
73
|
*/
|
|
33
|
-
exports.ISAFETransactionAuthorityAddSchema =
|
|
74
|
+
exports.ISAFETransactionAuthorityAddSchema = exports.ISAFETransactionAuthoritySchema.extend({
|
|
34
75
|
transaction: zod_1.default.object({
|
|
35
76
|
action: zod_1.default.literal(safe_transaction_models_1.SAFETransactionActionTypeSchema.Enum.ADD),
|
|
36
|
-
data:
|
|
77
|
+
data: exports.ISAFETransactionAuthorityDataSchema,
|
|
37
78
|
}),
|
|
38
79
|
});
|
|
39
80
|
/**
|
|
40
81
|
* This is the schema for the authority transaction update.
|
|
41
82
|
*/
|
|
42
|
-
exports.ISAFETransactionAuthorityUpdateSchema =
|
|
83
|
+
exports.ISAFETransactionAuthorityUpdateSchema = exports.ISAFETransactionAuthoritySchema.extend({
|
|
43
84
|
transaction: zod_1.default.object({
|
|
44
85
|
action: zod_1.default.literal(safe_transaction_models_1.SAFETransactionActionTypeSchema.Enum.UPDATE),
|
|
45
|
-
data:
|
|
86
|
+
data: exports.ISAFETransactionAuthorityDataSchema,
|
|
46
87
|
}),
|
|
47
88
|
});
|
|
48
89
|
/**
|
|
49
90
|
* This is the schema for the authority transaction remove.
|
|
50
91
|
*/
|
|
51
|
-
exports.ISAFETransactionAuthorityDeleteSchema =
|
|
92
|
+
exports.ISAFETransactionAuthorityDeleteSchema = exports.ISAFETransactionAuthoritySchema.extend({
|
|
52
93
|
transaction: zod_1.default.object({
|
|
53
94
|
action: zod_1.default.literal(safe_transaction_models_1.SAFETransactionActionTypeSchema.Enum.DELETE),
|
|
54
|
-
data:
|
|
95
|
+
data: exports.ISAFETransactionAuthorityDataSchema,
|
|
55
96
|
}),
|
|
56
97
|
});
|