New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@metamask/api-specs

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/api-specs

This repository contains the OpenRPC specification for MetaMask's Wallet JSON-RPC API. You can view the specs in the following formats:

0.10.15
Source
npm
Version published
Weekly downloads
2.5K
89.37%
Maintainers
0
Weekly downloads
 
Created
Source

MetaMask Wallet API specification

This repository contains the OpenRPC specification for MetaMask's Wallet JSON-RPC API. You can view the specs in the following formats:

  • MetaMask developer docs interactive API reference
  • OpenRPC playground
  • Latest build

OpenRPC is way to specify JSON-RPC APIs that is versionable, human-readable, and machine-readable. It improves the accuracy of documentation, APIs, and clients.

Contribute

You can contribute to the API specs using the following steps.

Note: These steps are for updating the API specs. To make a significant change to the API itself, please submit a MetaMask Improvement Proposal (MIP).

  • Edit the API specs in the openrpc.yaml file. See the OpenRPC docs for more information on how to format the specs.
  • Run yarn install if you haven't previously set up the repository.
  • Run yarn run build to re-generate the output file: dist/build/openrpc.json.
  • To view the result, paste that file's contents into the OpenRPC playground.

For information about publishing changes to the interactive API reference in the MetaMask developer docs, see the docs contribution guidelines.

Build process

When you build the project, the following happens:

  • The MetaMask-specific API specs openrpc.yaml are loaded from the local file system.
  • The Ethereum Execution API specs are fetched from a remote URL and methods not supported/implemented by MetaMask are filtered out.
  • The local MetaMask specs are merged with the Ethereum specs.
  • Each Ethereum method is tagged with the "Ethereum API" tag.
  • The merged and filtered specs are written out to temporary files:
    • src/build/openrpc.json
    • src/build/multichain-openrpc.json
  • These files are output to the dist folder and the src/build contents are deleted.

Publishing process

On release, the specs are published to npm at @metamask/api-specs and to GitHub Pages.

For information about publishing to the interactive API reference in the MetaMask developer docs, see the docs contribution guidelines.

FAQs

Package last updated on 07 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts