API Reference
This section provides a comprehensive guide on how to use the XRPL Snap API. It covers installation, interaction with the XRPL Snap, network management, and handling transactions, including exporting the private key.
Installation
To install the XRP Ledger Snap in your MetaMask environment, use the following request:
For Development: If you are developing the XRP Ledger Snap locally, use this request to install it from your local environment:
This is only for developer looking to contribute to the Snap
Interact with the Snap
Once the XRP Ledger Snap is installed, you can interact with it using the following methods:
Making RPC Requests
You can interact with the XRP Ledger via the Snap by sending RPC requests. Here is an example:
This example requests account information from the XRP Ledger.
Network Management
Get Supported Networks
To retrieve a list of networks supported by the XRPL Snap:
Get Current Network
To check the currently active network:
Change the Selected Network
To switch to a different network:
Signing and Submitting Transactions
The XRP Ledger Snap allows you to sign and submit transactions directly from your DApp.
Sign and Submit a Transaction
To sign and submit a transaction to the XRP Ledger:
Sign a Transaction Without Submitting
If you only need to sign a transaction without submitting it to the network:
Normally you will use the xrpl_signAndSubmit method.
Export Private Key
To display the user's private key in the XRP Ledger Snap use this method.
The private key never leaves the MetaMask environment, therefore you as a developer can not access to it.
Last updated