Introductionโ
GemWallet has already presented its beta version in a previous article, but now are working hard on version 2.0.0.
You can find the last source code of version 2.0.0 on the release/2.0.0 branch.
In this article, I am going to explain to you what changes in this version and what is planned on the TODO list before going to the Chrome Store.
What's new?โ
๐ฑ Features:
-
Refactor transaction payment API
- Make the payload simpler
- Return the hash of the transaction in case of a successful transaction
- Return an error in case of an unsuccessful transaction
-
Inform the user when the password is wrong
-
Allow the user to go to the previous page on import seed phrase or create a new wallet
-
Inform users when they don't have enough funds in their wallet before executing a transaction
๐งฐ Tech Improvements:
- Replace constants by enum
- Properly catch errors
- Refactor onboardings
- Disconnect the WebSocket to the ledger before the extension closes
- Catch errors within Sentry
And much more, you can check the release 2.0.0 pull request to see the other improvements.
How to install it?โ
To install the last beta version, it's pretty easy:
-
Download it here
-
Extract the zip file you have just downloaded
-
Install it in your web browser:
- Chrome: At the top right, click on , "More tools" and then "Extensions".
- Brave: At the top right, click on , then "Extensions".
-
Activate the developer mode by switching on the slider
-
Click on "Load unpacked" and select the folder of your extension.
-
Congrats ๐ you now have GemWallet installed.
The video below is put at the right timestamp to show you how to install GemWallet within your web browser.
How to use it?โ
To use GemWallet, you need to use the GemWallet API described in the documentation.
Unfortunately, the documentation is not up to date as the package is still under development.
I am going to show you how to connect the version beta with the following code snippet:
import { isConnected, sendPayment } from "@gemwallet/api";
export function Checkout() {
const handlePayment = () => {
// We make sure that we are connected to the ledger with the isConnected API
isConnected().then((isConnected) => {
if (isConnected) {
const transaction = {
amount: "0.999999",
destination: "rNvFCZXpDtGeQ3bSas15wGLN6N2stGmA9o",
};
// We send the payment to the extension which will forward it to the XRP Ledger
sendPayment(transaction)
.then((trHash) => {
// If the transaction is a success, the promise returns a transaction hash
console.log("Transaction Hash: ", trHash);
})
.catch((e) => {
console.log("THE ERROR: ", e);
});
} else {
console.log("You are not connected");
}
});
};
return (
<button
onClick={handlePayment}
className="mt-10 w-full bg-indigo-600 border border-transparent rounded-md py-3 px-8 flex items-center justify-center text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
>
PAY
</button>
);
}
In order to don't pollute the npm repository of GemWallet the beta is under the package: @gemwallet-beta/api.
The code above is extracted from this repository where you can have an example of implementation: https://github.com/FlorianBouron/gemwallet-store-demo/tree/release/2.0.0
How to give feedback?โ
Giving us feedback has never been that easy, there are a few ways:
What's next?โ
- Improvements in explaining the reserved amount within the Ledger
- Enable GemWallet to be connected to the mainnet
- Answer to your feedback
- Create a Sign Method to allow authentication within web3 pages
- Make the 2.0.0 release
- And much more (Stay tuned for the next announcements, follow us on Twitter).