Parameterize typescript handlers
Open
area-developing
type-enhancement
- Dominant language
- TypeScript
- Stars
- 853
- Forks
- 662
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 8
Description
`SnapHandler` used in snap typescript types should be parameterized with a generic that allows you to customize the params value of request
```
export type SnapRpcHandlerunknown[] | { [key: string]: unknown } = (args: {
origin: string;
request: JsonRpcRequest;
}) => Promise;
```
Contributor guide
Research direction
Locate the SnapHandler definition and its TypeScript usages in the snaps repository, then compare them with the requested generic SnapRpcHandler shape. Update the handler type so request params can be customized, and run the repository's TypeScript checks to confirm existing usages still type-check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100