Invalid `wallet_requestSnaps` and `wallet_invokeSnap` specs

Open
#204 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
api, documentation

Research direction

Search the repository for the wallet_requestSnaps and wallet_invokeSnap specs and examples. Update each params definition and example so params is an object rather than an array, matching the TypeScript shapes in the issue. Done means both methods consistently use the corrected object format.

Written by the indexing model from the issue text.

Description

bug

wallet_requestSnaps and wallet_invokeSnap use an object as params, but on the docs, the params are currently being wrapped in an array.

The spec and examples should be updated to use this format:

wallet_requestSnaps
type Request = {
  method: 'wallet_requestSnaps';
  params: Record<SnapId, { version?: SemVerVersion; }>;
}
wallet_invokeSnap
type Request = {
  method: 'wallet_invokeSnap',
  params: {
    snapId: SnapId;
    request: {
      method: string;
      params: Json;
    }
  }
}
Dominant language
JavaScript
Stars
39
Forks
16
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MetaMask/api-specs

All issues in MetaMask/api-specs

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.