Skip to content

Commit 4207354

Browse files
docs: add "API Documentation" section to the readme (#413)
1 parent 149e7cf commit 4207354

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,27 @@ yarn add @metamask/snap-solana-wallet
2020

2121
This dual repository setup allows you to develop and test the Solana Wallet Snap alongside the main MetaMask extension. The snap is installed as a dependency in the MetaMask extension repository, where it can be tested and integrated.
2222

23+
## API Documentation
24+
25+
MetaMask interacts with the Solana Wallet Snap via its [JSON-RPC API](packages/snap/openrpc.json). The complete API specification is documented in the OpenRPC format.
26+
27+
### Viewing the API Documentation
28+
29+
The API documentation is located in [`packages/snap/openrpc.json`](packages/snap/openrpc.json). To view it in a user-friendly format:
30+
31+
1. Go to the [OpenRPC Playground](https://playground.open-rpc.org/), or any other OpenRPC viewer of your liking
32+
2. Copy the contents of [`packages/snap/openrpc.json`](packages/snap/openrpc.json)
33+
3. Paste it into the playground's editor
34+
4. Explore the interactive documentation with method details, parameters, examples, and error specifications
35+
36+
### Available Methods
37+
38+
The API includes methods for:
39+
40+
- **Wallet operations** - Account management, transaction signing and broadcasting, and message signing
41+
- **Protocol requests** - Direct interaction with Solana RPC methods
42+
- **Client-only requests** (as defined in [SIP-31](https://github.com/MetaMask/SIPs/blob/main/SIPS/sip-31.md)) - For operations like Swap/Bridge without user confirmation
43+
2344
## Contributing
2445

2546
We welcome contributions to the Solana Wallet Snap! Please read our [Contributing](docs/contributing.md) guidelines to get started.

0 commit comments

Comments
 (0)