api-specs icon indicating copy to clipboard operation
api-specs copied to clipboard

Invalid `wallet_requestSnaps` and `wallet_invokeSnap` specs

Open Mrtenz opened this issue 1 year ago • 1 comments

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;
    }
  }
}

Mrtenz avatar Mar 25 '24 14:03 Mrtenz

rel #193

shanejonas avatar Apr 18 '24 16:04 shanejonas