Last updated
Last updated
Before you can install and interact with the XRP Ledger Snap, you need to connect your DApp to MetaMask and retrieve the provider object.
Steps:
Install MetaMask: Ensure that the MetaMask extension is installed in your browser. You can download it .
Connect to MetaMask:
In your DApp, prompt the user to connect their MetaMask wallet. This will give you access to the Ethereum provider, which is required to interact with Snaps.
Verify that your provider has snaps support
Example:
*If you are using typescript, you might want to install the package: @metamask/providers
Once you have connected to MetaMask and obtained the provider, you can proceed to install the XRP Ledger Snap. To install the XRP Ledger Snap call the wallet_requestSnaps
method with the npm
package of the XRP Ledger Snap: npm:@peersyst/xrpl-snap
.
Once the XRP Ledger Snap is installed, you can interact with the XRP Ledger directly from your DApp.
After installation, use the XRP Ledger Snap's API to interact with the XRP Ledger. Below is an example of how to fetch the balance of the connected account.
To know more about the API of the Snap visit the API reference page