@getpara/shared 1.33.0 → 1.34.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.
- package/dist/cjs/schemas/permissionsV2.js +72 -12
- package/dist/cjs/schemas/permissionsV2Lifecycle.js +2 -3
- package/dist/esm/schemas/permissionsV2.js +70 -10
- package/dist/esm/schemas/permissionsV2Lifecycle.js +2 -3
- package/dist/types/schemas/permissionsV2.d.ts +178 -147
- package/dist/types/schemas/permissionsV2.d.ts.map +1 -1
- package/dist/types/schemas/permissionsV2Lifecycle.d.ts +170 -196
- package/dist/types/schemas/permissionsV2Lifecycle.d.ts.map +1 -1
- package/dist/types/types/partner.d.ts +1 -0
- package/dist/types/types/partner.d.ts.map +1 -1
- package/dist/types/types/pending-transaction.d.ts +4 -8
- package/dist/types/types/pending-transaction.d.ts.map +1 -1
- package/dist/types/types/permissions.d.ts +3 -1
- package/dist/types/types/permissions.d.ts.map +1 -1
- package/dist/types/types/signing.d.ts +39 -0
- package/dist/types/types/signing.d.ts.map +1 -1
- package/dist/types/types/webhook.d.ts +2 -2
- package/dist/types/types/webhook.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.permissionsV2ValidationErrorSchema = exports.permissionsV2DelegationConsentDiscoveryResponseSchema = exports.permissionsV2DelegationConsentSubmissionResponseSchema = exports.permissionsV2DelegationConsentRequestSchema = void 0;
|
|
3
|
+
exports.permissionsV2DelegationConsentNativeStandingMutationSchema = exports.permissionsV2DelegationConsentStandingMutationSchema = exports.permissionsV2DelegationConsentMutationSchema = exports.permissionsV2DelegationConsentApiStatusSchema = exports.permissionsV2DelegationPolicyDefinitionSchema = exports.permissionsV2PartnerAuthoredPolicyDefinitionSchema = exports.permissionsV2PartnerPolicyCandidateSchema = exports.permissionsV2PolicyRuleSchema = exports.permissionsV2RuleActionsSchema = exports.permissionsV2ConditionalApprovalCaseListSchema = exports.permissionsV2TransactionSignatureCollectionSchema = exports.permissionsV2ConditionalApprovalSignatureSchema = exports.permissionsV2ConditionalApprovalDecisionSchema = exports.permissionsV2AuthorizationConfigurationViewSchema = exports.permissionsV2AuthorizationConfigurationWriteSchema = exports.permissionsV2AuthorizationScopeBindingViewSchema = exports.permissionsV2AuthorizationScopeBindingWriteSchema = exports.permissionsV2AuthoritySetViewSchema = exports.permissionsV2AuthoritySetWriteSchema = exports.permissionsV2AuthorityAssignmentSchema = exports.permissionsV2ConditionalApprovalCaseViewSchema = exports.permissionsV2ConditionalApprovalRequirementIdentitySchema = exports.permissionsV2ConditionalApprovalDecisionCapabilitySchema = exports.permissionsV2ConditionalApprovalDecisionUnavailableReasonSchema = exports.permissionsV2ConditionalApprovalCaseStatusSchema = exports.permissionsV2ConditionalApprovalRequirementSchema = exports.permissionsV2ConditionalApprovalSafeKnobSchema = exports.permissionsV2ConditionalApprovalStageSchema = exports.permissionsV2ConditionalApprovalEligibilitySchema = exports.permissionsV2PartnerPolicyMetadataSchema = exports.permissionsV2PolicyMetadataSchema = exports.permissionsV2PartnerAuthoredPolicySelectorSchema = exports.permissionsV2ConditionSchema = exports.policyAuthoringJsonObjectSchema = exports.policyAuthoringJsonValueSchema = exports.policyAuthoringJsonPrimitiveSchema = exports.permissionsV2RuleActionSchema = exports.permissionsV2SigningRequestTypeSchema = exports.permissionsV2SigningWalletTypeSchema = exports.permissionsV2AggregateOperatorSchema = exports.permissionsV2CompareOperatorSchema = exports.permissionsV2PolicyEffectSchema = exports.permissionsV2PolicyModeSchema = exports.permissionsV2PolicyLayerSchema = exports.permissionsV2ParameterDeclarationSchema = exports.permissionsV2RuleActionsByWalletType = exports.permissionsV2RuleActions = exports.permissionsV2SigningRequestTypes = exports.policyAuthoringSigningRequestRoutes = exports.policyAuthoringSigningWalletTypes = void 0;
|
|
4
|
+
exports.permissionsV2ValidationErrorSchema = exports.permissionsV2DelegationConsentDiscoveryResponseSchema = exports.permissionsV2DelegationConsentSubmissionResponseSchema = exports.permissionsV2DelegationConsentRequestSchema = exports.permissionsV2DelegationConsentViewSchema = exports.permissionsV2DelegationConsentSubmissionSchema = exports.permissionsV2DelegationConsentStandingRouteMutationSchema = void 0;
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const permissionsV2UserParameters_js_1 = require("./permissionsV2UserParameters.js");
|
|
7
7
|
exports.policyAuthoringSigningWalletTypes = ['EVM', 'SOLANA', 'COSMOS', 'STELLAR', 'SUI'];
|
|
@@ -31,6 +31,28 @@ exports.permissionsV2SigningRequestTypes = [
|
|
|
31
31
|
'sui_transaction',
|
|
32
32
|
'raw_message',
|
|
33
33
|
];
|
|
34
|
+
exports.permissionsV2RuleActions = [
|
|
35
|
+
'transfer_native',
|
|
36
|
+
'transfer_tokens',
|
|
37
|
+
'call_contract',
|
|
38
|
+
'raw_signature',
|
|
39
|
+
'approve_tokens',
|
|
40
|
+
'transfer_nfts',
|
|
41
|
+
'deploy_contract',
|
|
42
|
+
'execute_safe_transaction',
|
|
43
|
+
'sign_message',
|
|
44
|
+
'sign_typed_data',
|
|
45
|
+
'sign_authorization',
|
|
46
|
+
];
|
|
47
|
+
const everyWalletTypeRuleActions = ['transfer_native', 'transfer_tokens', 'call_contract', 'raw_signature'];
|
|
48
|
+
exports.permissionsV2RuleActionsByWalletType = {
|
|
49
|
+
EVM: exports.permissionsV2RuleActions,
|
|
50
|
+
SOLANA: everyWalletTypeRuleActions,
|
|
51
|
+
COSMOS: everyWalletTypeRuleActions,
|
|
52
|
+
STELLAR: everyWalletTypeRuleActions,
|
|
53
|
+
SUI: everyWalletTypeRuleActions,
|
|
54
|
+
};
|
|
55
|
+
const permissionsV2SelectorListMaximum = 100;
|
|
34
56
|
const nonEmptyStringSchema = zod_1.z.string().min(1);
|
|
35
57
|
exports.permissionsV2ParameterDeclarationSchema = zod_1.z
|
|
36
58
|
.object({
|
|
@@ -38,18 +60,14 @@ exports.permissionsV2ParameterDeclarationSchema = zod_1.z
|
|
|
38
60
|
label: nonEmptyStringSchema,
|
|
39
61
|
})
|
|
40
62
|
.strict();
|
|
41
|
-
const uniqueNonEmptyStringsSchema = zod_1.z
|
|
42
|
-
.array(nonEmptyStringSchema)
|
|
43
|
-
.min(1)
|
|
44
|
-
.refine((values) => new Set(values).size === values.length, 'values must be unique');
|
|
45
63
|
exports.permissionsV2PolicyLayerSchema = zod_1.z.enum(['para', 'partner']);
|
|
46
64
|
exports.permissionsV2PolicyModeSchema = zod_1.z.enum(['guardrail', 'delegation']);
|
|
47
65
|
exports.permissionsV2PolicyEffectSchema = zod_1.z.enum(['allow', 'deny', 'require_approval']);
|
|
48
66
|
exports.permissionsV2CompareOperatorSchema = zod_1.z.enum(['eq', 'ne', 'lt', 'lte', 'gt', 'gte', 'in']);
|
|
49
67
|
exports.permissionsV2AggregateOperatorSchema = zod_1.z.enum(['lt', 'lte', 'gt', 'gte']);
|
|
50
68
|
exports.permissionsV2SigningWalletTypeSchema = zod_1.z.enum(exports.policyAuthoringSigningWalletTypes);
|
|
51
|
-
exports.permissionsV2SigningRequestRouteSchema = zod_1.z.enum(exports.policyAuthoringSigningRequestRoutes);
|
|
52
69
|
exports.permissionsV2SigningRequestTypeSchema = zod_1.z.enum(exports.permissionsV2SigningRequestTypes);
|
|
70
|
+
exports.permissionsV2RuleActionSchema = zod_1.z.enum(exports.permissionsV2RuleActions);
|
|
53
71
|
exports.policyAuthoringJsonPrimitiveSchema = zod_1.z.union([
|
|
54
72
|
zod_1.z.string(),
|
|
55
73
|
zod_1.z.number(),
|
|
@@ -102,13 +120,35 @@ exports.permissionsV2ConditionSchema = zod_1.z.lazy(() => zod_1.z.discriminatedU
|
|
|
102
120
|
})
|
|
103
121
|
.strict(),
|
|
104
122
|
]));
|
|
123
|
+
function duplicateValues(values) {
|
|
124
|
+
return Array.from(new Set(values.filter((value, index) => values.indexOf(value) !== index)));
|
|
125
|
+
}
|
|
126
|
+
function selectorListEntriesSchema(field) {
|
|
127
|
+
const entries = zod_1.z.array(nonEmptyStringSchema).min(1, `${field} must list at least 1 entry`);
|
|
128
|
+
return field === 'chainId'
|
|
129
|
+
? entries
|
|
130
|
+
: entries.max(permissionsV2SelectorListMaximum, `${field} must list at most ${permissionsV2SelectorListMaximum} entries`);
|
|
131
|
+
}
|
|
132
|
+
function selectorListSchema(field) {
|
|
133
|
+
return zod_1.z.union([
|
|
134
|
+
nonEmptyStringSchema,
|
|
135
|
+
selectorListEntriesSchema(field).superRefine((values, context) => {
|
|
136
|
+
const duplicates = duplicateValues(values);
|
|
137
|
+
if (duplicates.length > 0) {
|
|
138
|
+
context.addIssue({
|
|
139
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
140
|
+
message: `${field} lists ${duplicates.join(', ')} more than once`,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}),
|
|
144
|
+
]);
|
|
145
|
+
}
|
|
105
146
|
const permissionsV2PartnerAuthoredPolicySelectorObjectSchema = zod_1.z
|
|
106
147
|
.object({
|
|
107
|
-
walletId:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
requestType: exports.permissionsV2SigningRequestTypeSchema.optional(),
|
|
148
|
+
walletId: selectorListSchema('walletId').optional(),
|
|
149
|
+
userId: selectorListSchema('userId').optional(),
|
|
150
|
+
chainId: selectorListSchema('chainId').optional(),
|
|
151
|
+
walletType: exports.permissionsV2SigningWalletTypeSchema,
|
|
112
152
|
})
|
|
113
153
|
.strict();
|
|
114
154
|
exports.permissionsV2PartnerAuthoredPolicySelectorSchema = permissionsV2PartnerAuthoredPolicySelectorObjectSchema;
|
|
@@ -620,10 +660,30 @@ exports.permissionsV2ConditionalApprovalCaseListSchema = zod_1.z
|
|
|
620
660
|
nextBeforeCaseId: conditionalApprovalIdentifierSchema.optional(),
|
|
621
661
|
})
|
|
622
662
|
.strict();
|
|
663
|
+
const permissionsV2RuleActionListSchema = zod_1.z
|
|
664
|
+
.array(exports.permissionsV2RuleActionSchema)
|
|
665
|
+
.min(1, 'actions must name at least one action or be "all"')
|
|
666
|
+
.superRefine((actions, context) => {
|
|
667
|
+
const duplicates = duplicateValues(actions);
|
|
668
|
+
if (duplicates.length > 0) {
|
|
669
|
+
context.addIssue({
|
|
670
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
671
|
+
message: `actions lists ${duplicates.join(', ')} more than once`,
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
exports.permissionsV2RuleActionsSchema = zod_1.z.union([zod_1.z.literal('all'), permissionsV2RuleActionListSchema], {
|
|
676
|
+
errorMap: (_issue, context) => ({
|
|
677
|
+
message: context.data === undefined
|
|
678
|
+
? 'actions is required: name the actions this rule governs or use "all"'
|
|
679
|
+
: `actions must be "all" or a list of actions, received ${JSON.stringify(context.data)}`,
|
|
680
|
+
}),
|
|
681
|
+
});
|
|
623
682
|
exports.permissionsV2PolicyRuleSchema = zod_1.z
|
|
624
683
|
.object({
|
|
625
684
|
id: nonEmptyStringSchema,
|
|
626
685
|
effect: exports.permissionsV2PolicyEffectSchema,
|
|
686
|
+
actions: exports.permissionsV2RuleActionsSchema,
|
|
627
687
|
when: exports.permissionsV2ConditionSchema,
|
|
628
688
|
approvalRequirement: exports.permissionsV2ConditionalApprovalRequirementSchema.optional(),
|
|
629
689
|
})
|
|
@@ -9,7 +9,6 @@ const permissionsV2PolicyViewSelectorSchema = permissionsV2_js_1.permissionsV2Pa
|
|
|
9
9
|
actorId: nonEmptyStringSchema.optional(),
|
|
10
10
|
partnerId: nonEmptyStringSchema.optional(),
|
|
11
11
|
appId: nonEmptyStringSchema.optional(),
|
|
12
|
-
userId: nonEmptyStringSchema.optional(),
|
|
13
12
|
walletOwnerPartnerId: nonEmptyStringSchema.optional(),
|
|
14
13
|
feature: nonEmptyStringSchema.optional(),
|
|
15
14
|
});
|
|
@@ -51,10 +50,10 @@ exports.permissionsV2PolicyUsageMeterSchema = zod_1.z
|
|
|
51
50
|
.object({
|
|
52
51
|
ruleId: nonEmptyStringSchema,
|
|
53
52
|
conditionPath: nonEmptyStringSchema,
|
|
54
|
-
fact: zod_1.z.enum(['wallet.spend.native', 'wallet.spend.erc20']),
|
|
53
|
+
fact: zod_1.z.enum(['wallet.spend.native', 'wallet.spend.erc20', 'wallet.spend.token']),
|
|
55
54
|
operator: zod_1.z.enum(['lt', 'lte', 'gt', 'gte']),
|
|
56
55
|
ruleEffect: permissionsV2_js_1.permissionsV2PolicyEffectSchema,
|
|
57
|
-
assetType: zod_1.z.enum(['NATIVE', 'ERC20']),
|
|
56
|
+
assetType: zod_1.z.enum(['NATIVE', 'ERC20', 'TOKEN']),
|
|
58
57
|
tokenAddress: nonEmptyStringSchema.optional(),
|
|
59
58
|
chainId: nonEmptyStringSchema,
|
|
60
59
|
windowMs: zod_1.z.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
@@ -27,6 +27,28 @@ export const permissionsV2SigningRequestTypes = [
|
|
|
27
27
|
'sui_transaction',
|
|
28
28
|
'raw_message',
|
|
29
29
|
];
|
|
30
|
+
export const permissionsV2RuleActions = [
|
|
31
|
+
'transfer_native',
|
|
32
|
+
'transfer_tokens',
|
|
33
|
+
'call_contract',
|
|
34
|
+
'raw_signature',
|
|
35
|
+
'approve_tokens',
|
|
36
|
+
'transfer_nfts',
|
|
37
|
+
'deploy_contract',
|
|
38
|
+
'execute_safe_transaction',
|
|
39
|
+
'sign_message',
|
|
40
|
+
'sign_typed_data',
|
|
41
|
+
'sign_authorization',
|
|
42
|
+
];
|
|
43
|
+
const everyWalletTypeRuleActions = ['transfer_native', 'transfer_tokens', 'call_contract', 'raw_signature'];
|
|
44
|
+
export const permissionsV2RuleActionsByWalletType = {
|
|
45
|
+
EVM: permissionsV2RuleActions,
|
|
46
|
+
SOLANA: everyWalletTypeRuleActions,
|
|
47
|
+
COSMOS: everyWalletTypeRuleActions,
|
|
48
|
+
STELLAR: everyWalletTypeRuleActions,
|
|
49
|
+
SUI: everyWalletTypeRuleActions,
|
|
50
|
+
};
|
|
51
|
+
const permissionsV2SelectorListMaximum = 100;
|
|
30
52
|
const nonEmptyStringSchema = z.string().min(1);
|
|
31
53
|
export const permissionsV2ParameterDeclarationSchema = z
|
|
32
54
|
.object({
|
|
@@ -34,18 +56,14 @@ export const permissionsV2ParameterDeclarationSchema = z
|
|
|
34
56
|
label: nonEmptyStringSchema,
|
|
35
57
|
})
|
|
36
58
|
.strict();
|
|
37
|
-
const uniqueNonEmptyStringsSchema = z
|
|
38
|
-
.array(nonEmptyStringSchema)
|
|
39
|
-
.min(1)
|
|
40
|
-
.refine((values) => new Set(values).size === values.length, 'values must be unique');
|
|
41
59
|
export const permissionsV2PolicyLayerSchema = z.enum(['para', 'partner']);
|
|
42
60
|
export const permissionsV2PolicyModeSchema = z.enum(['guardrail', 'delegation']);
|
|
43
61
|
export const permissionsV2PolicyEffectSchema = z.enum(['allow', 'deny', 'require_approval']);
|
|
44
62
|
export const permissionsV2CompareOperatorSchema = z.enum(['eq', 'ne', 'lt', 'lte', 'gt', 'gte', 'in']);
|
|
45
63
|
export const permissionsV2AggregateOperatorSchema = z.enum(['lt', 'lte', 'gt', 'gte']);
|
|
46
64
|
export const permissionsV2SigningWalletTypeSchema = z.enum(policyAuthoringSigningWalletTypes);
|
|
47
|
-
export const permissionsV2SigningRequestRouteSchema = z.enum(policyAuthoringSigningRequestRoutes);
|
|
48
65
|
export const permissionsV2SigningRequestTypeSchema = z.enum(permissionsV2SigningRequestTypes);
|
|
66
|
+
export const permissionsV2RuleActionSchema = z.enum(permissionsV2RuleActions);
|
|
49
67
|
export const policyAuthoringJsonPrimitiveSchema = z.union([
|
|
50
68
|
z.string(),
|
|
51
69
|
z.number(),
|
|
@@ -98,13 +116,35 @@ export const permissionsV2ConditionSchema = z.lazy(() => z.discriminatedUnion('k
|
|
|
98
116
|
})
|
|
99
117
|
.strict(),
|
|
100
118
|
]));
|
|
119
|
+
function duplicateValues(values) {
|
|
120
|
+
return Array.from(new Set(values.filter((value, index) => values.indexOf(value) !== index)));
|
|
121
|
+
}
|
|
122
|
+
function selectorListEntriesSchema(field) {
|
|
123
|
+
const entries = z.array(nonEmptyStringSchema).min(1, `${field} must list at least 1 entry`);
|
|
124
|
+
return field === 'chainId'
|
|
125
|
+
? entries
|
|
126
|
+
: entries.max(permissionsV2SelectorListMaximum, `${field} must list at most ${permissionsV2SelectorListMaximum} entries`);
|
|
127
|
+
}
|
|
128
|
+
function selectorListSchema(field) {
|
|
129
|
+
return z.union([
|
|
130
|
+
nonEmptyStringSchema,
|
|
131
|
+
selectorListEntriesSchema(field).superRefine((values, context) => {
|
|
132
|
+
const duplicates = duplicateValues(values);
|
|
133
|
+
if (duplicates.length > 0) {
|
|
134
|
+
context.addIssue({
|
|
135
|
+
code: z.ZodIssueCode.custom,
|
|
136
|
+
message: `${field} lists ${duplicates.join(', ')} more than once`,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}),
|
|
140
|
+
]);
|
|
141
|
+
}
|
|
101
142
|
const permissionsV2PartnerAuthoredPolicySelectorObjectSchema = z
|
|
102
143
|
.object({
|
|
103
|
-
walletId:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
requestType: permissionsV2SigningRequestTypeSchema.optional(),
|
|
144
|
+
walletId: selectorListSchema('walletId').optional(),
|
|
145
|
+
userId: selectorListSchema('userId').optional(),
|
|
146
|
+
chainId: selectorListSchema('chainId').optional(),
|
|
147
|
+
walletType: permissionsV2SigningWalletTypeSchema,
|
|
108
148
|
})
|
|
109
149
|
.strict();
|
|
110
150
|
export const permissionsV2PartnerAuthoredPolicySelectorSchema = permissionsV2PartnerAuthoredPolicySelectorObjectSchema;
|
|
@@ -616,10 +656,30 @@ export const permissionsV2ConditionalApprovalCaseListSchema = z
|
|
|
616
656
|
nextBeforeCaseId: conditionalApprovalIdentifierSchema.optional(),
|
|
617
657
|
})
|
|
618
658
|
.strict();
|
|
659
|
+
const permissionsV2RuleActionListSchema = z
|
|
660
|
+
.array(permissionsV2RuleActionSchema)
|
|
661
|
+
.min(1, 'actions must name at least one action or be "all"')
|
|
662
|
+
.superRefine((actions, context) => {
|
|
663
|
+
const duplicates = duplicateValues(actions);
|
|
664
|
+
if (duplicates.length > 0) {
|
|
665
|
+
context.addIssue({
|
|
666
|
+
code: z.ZodIssueCode.custom,
|
|
667
|
+
message: `actions lists ${duplicates.join(', ')} more than once`,
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
export const permissionsV2RuleActionsSchema = z.union([z.literal('all'), permissionsV2RuleActionListSchema], {
|
|
672
|
+
errorMap: (_issue, context) => ({
|
|
673
|
+
message: context.data === undefined
|
|
674
|
+
? 'actions is required: name the actions this rule governs or use "all"'
|
|
675
|
+
: `actions must be "all" or a list of actions, received ${JSON.stringify(context.data)}`,
|
|
676
|
+
}),
|
|
677
|
+
});
|
|
619
678
|
export const permissionsV2PolicyRuleSchema = z
|
|
620
679
|
.object({
|
|
621
680
|
id: nonEmptyStringSchema,
|
|
622
681
|
effect: permissionsV2PolicyEffectSchema,
|
|
682
|
+
actions: permissionsV2RuleActionsSchema,
|
|
623
683
|
when: permissionsV2ConditionSchema,
|
|
624
684
|
approvalRequirement: permissionsV2ConditionalApprovalRequirementSchema.optional(),
|
|
625
685
|
})
|
|
@@ -6,7 +6,6 @@ const permissionsV2PolicyViewSelectorSchema = permissionsV2PartnerAuthoredPolicy
|
|
|
6
6
|
actorId: nonEmptyStringSchema.optional(),
|
|
7
7
|
partnerId: nonEmptyStringSchema.optional(),
|
|
8
8
|
appId: nonEmptyStringSchema.optional(),
|
|
9
|
-
userId: nonEmptyStringSchema.optional(),
|
|
10
9
|
walletOwnerPartnerId: nonEmptyStringSchema.optional(),
|
|
11
10
|
feature: nonEmptyStringSchema.optional(),
|
|
12
11
|
});
|
|
@@ -48,10 +47,10 @@ export const permissionsV2PolicyUsageMeterSchema = z
|
|
|
48
47
|
.object({
|
|
49
48
|
ruleId: nonEmptyStringSchema,
|
|
50
49
|
conditionPath: nonEmptyStringSchema,
|
|
51
|
-
fact: z.enum(['wallet.spend.native', 'wallet.spend.erc20']),
|
|
50
|
+
fact: z.enum(['wallet.spend.native', 'wallet.spend.erc20', 'wallet.spend.token']),
|
|
52
51
|
operator: z.enum(['lt', 'lte', 'gt', 'gte']),
|
|
53
52
|
ruleEffect: permissionsV2PolicyEffectSchema,
|
|
54
|
-
assetType: z.enum(['NATIVE', 'ERC20']),
|
|
53
|
+
assetType: z.enum(['NATIVE', 'ERC20', 'TOKEN']),
|
|
55
54
|
tokenAddress: nonEmptyStringSchema.optional(),
|
|
56
55
|
chainId: nonEmptyStringSchema,
|
|
57
56
|
windowMs: z.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|