MetaMask / MetaMask/snaps

Parameterize typescript handlers

Open
#807 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.