If you have a MetaMask wallet now you have an XRPL one.
Securely manage your XRP and interact with XRPL-based DApps directly from MetaMask.
The XRP Ledger for MetaMask is an extension that allows users to interact with the XRP Ledger (XRPL) directly from their MetaMask wallet. This Snap introduces support for XRPL, enabling users to manage XRP and other tokens on the XRPL, perform transactions, and interact with XRPL-based decentralized applications (DApps).
- XRPL Integration: Manage XRP and XRPL tokens within MetaMask.
- Transaction Support: Send and receive XRP and other XRPL tokens.
- DApp Interaction: Use XRPL-based DApps seamlessly.
- Account Management: View account balances, transaction history, and other details.
- Secure and User-Controlled: Full control over your XRPL keys and permissions.
To use the XRP Ledger, first install it by following these steps:
- Open MetaMask: Ensure you have the latest version of the MetaMask extension installed in your browser.
- Navigate to Settings: Click on the MetaMask icon, go to settings, and look for the Snaps section.
- Add XRP Ledger: In the Snaps section, add the XRP Ledger by providing its URL or selecting it from the Snap store.
- Install Snap: Click on the XRP Ledger and follow the prompts to add it to your MetaMask wallet.
- Enable Snap: Once installed, enable the Snap and grant necessary permissions.
Here’s a basic guide to get started:
- Node.js
- MetaMask Flask
yarn
yarn start
- To only start the UI, navigate to
packages/site
and start from there. The same applies to the snap inpackages/snap
. - If you make changes to the snap, first remove the previously installed version to see the changes.
- Enable the MetaMask Flask in your extensions.
Use the following request to install the Snap:
provider.request({
method: 'wallet_requestSnaps',
params: {
['npm:xrpl-snap']: {},
},
});
For developing the snap, change the request to:
params: {
["local:http://localhost:8080"]: {},
},
To make requests using the RPC, use the following code:
provider.request({
method: 'wallet_invokeSnap',
params: {
snapId: 'npm:xrpl-snap',
request: {
method: 'xrpl_request',
params: { command: 'account_info', account: 'rBg...' },
},
},
});
- Get supported networks:
provider.request({
method: 'wallet_invokeSnap',
params: {
snapId: 'npm:xrpl-snap',
request: {
method: 'xrpl_getSupportedNetworks',
},
},
});
- Get current network:
provider.request({
method: 'wallet_invokeSnap',
params: {
snapId: 'npm:xrpl-snap',
request: {
method: 'xrpl_getActiveNetwork',
},
},
});
- Change the selected network:
provider.request({
method: 'wallet_invokeSnap',
params: {
snapId: 'npm:xrpl-snap',
request: {
method: 'xrpl_changeNetwork',
params: { chainId: 1 }, // Example chainId
},
},
});
To sign and submit transactions
provider.request({
method: 'wallet_invokeSnap',
params: {
snapId: 'npm:xrpl-snap',
request: {
method: 'xrpl_signAndSubmit',
params: {
TransactionType: 'Payment',
Account: 'rBg...',
Destination: 'rPT...',
Amount: '1000000', // Amount in drops
},
},
},
});
- If you only want to sing the transaction use
xrpl_sign
.
For support and further information, refer to the following resources:
- Documentation: https://docs.xrplsnap.com/
- XRPL Documentation: XRPL.org
- MetaMask Snaps Documentation: MetaMask Snaps
- Community Forums: Join discussions on MetaMask and XRPL community forums.
We welcome contributions to the XRP Ledger project. To contribute, please follow these steps:
- Fork the Repository: Fork the XRP Ledger repository on GitHub.
- Create a Branch: Create a new branch for your feature or bugfix.
- Submit a Pull Request: Submit a pull request with a detailed description of your changes.
- Author - Peersyst
- Website - https://peersyst.com/
- X - @peersyst
This project is licensed under the MIT License. See the LICENSE file for details.