-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
It would be useful for consumers to be able to import the ScopeConfig and related types.
Background
ScopeConfig is used in public API functions like createDelegation() and createOpenDelegation() as part of the options parameter. Currently, consumers cannot import these types directly, making it difficult to:
- Get proper TypeScript autocomplete when creating delegations
- Understand the structure of scope configurations
- Write type-safe code that works with scopes
Types to Export
1. Essential Scope Types (Primary)
ScopeConfig- Main discriminated union type covering all 9 scope typesErc20TransferScopeConfigErc20StreamingScopeConfigErc20PeriodicScopeConfigNativeTokenTransferScopeConfigNativeTokenStreamingScopeConfigNativeTokenPeriodicScopeConfigErc721ScopeConfigOwnershipScopeConfigFunctionCallScopeConfig
2. Supporting Builder Config Types (Nested Properties)
These types appear as properties in the scope configs above:
AllowedTargetsBuilderConfig- Used inFunctionCallScopeConfigAllowedMethodsBuilderConfig- Used inFunctionCallScopeConfigAllowedCalldataBuilderConfig- Used inFunctionCallScopeConfig,NativeTokenTransferScopeConfig, etc.ExactCalldataBuilderConfig- Used inFunctionCallScopeConfig,NativeTokenTransferScopeConfig, etc.ValueLteBuilderConfig- Used inFunctionCallScopeConfigMethodSelector- Used byAllowedMethodsBuilderConfig
3. Internal utility types (DO NOT EXPORT)
ConvertScopeConfigsToInputs- Allows thetypefield to accept bothScopeType.Xenum and string value
Benefits
Exporting these types will:
- Improve TypeScript DX: Consumers get autocomplete and type validation when creating scopes
- Better Documentation: Types serve as inline documentation for what properties are needed
- Clearer Error Messages: Individual scope types provide better compiler errors than just the union type
- API Completeness: If a type appears in a public API parameter, it should be importable
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels