You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param config.environment - The environment to be used for the caveat builder.
16
16
* @param config.scope - The scope to be used for the caveat builder. Optional - when not provided and redelegating, scope is inherited from the parent delegation.
17
17
* @param config.caveats - The caveats to be resolved, which can be either a CaveatBuilder or an array of Caveat or CaveatConfiguration. Optional - if not provided, only scope caveats will be used.
18
+
* @param config.hasInheritance - Whether the delegation has inheritance.
18
19
* @returns The resolved array of caveats.
19
20
*/
20
21
exportconstresolveCaveats=({
21
22
environment,
22
23
scope,
23
24
caveats,
25
+
hasInheritance,
24
26
}: {
25
27
environment: SmartAccountsEnvironment;
26
28
scope?: ScopeConfig;
27
29
caveats?: Caveats;
30
+
hasInheritance: boolean;
28
31
})=>{
32
+
if(!scope&&!hasInheritance){
33
+
thrownewError('Scope is required when the delegation has no inheritance');
34
+
}
35
+
29
36
// Create base caveat builder from scope if provided, otherwise use core caveat builder
0 commit comments