Interacting with Moonbeam Using MathWallet¶
MathWallet announced that is now natively supporting the Moonbase Alpha TestNet and Moonriver. This means that you are now able to interact with Moonbase Alpha and Moonriver using another wallet besides MetaMask.
In this tutorial, we'll go through how to setup MathWallet to connect to our TestNet and Moonriver. We'll also present a brief example of using MathWallet as a Web3 provider for other tools such as Remix.
First, you need to install the MathWallet browser extension installed, which you can get from their website.
With the browser extension installed, please open it and set a password.
Connect to Moonbase Alpha¶
In this part, we'll go through the process of connecting MathWallet to Moonbase Alpha. Enable Moonbase Alpha under Settings (top right gear icon) -> Networks -> Ethereum.
And lastly, on the main screen, click Switch Network and select Moonbase Alpha
And that is it, you now have MathWallet connected to the Moonbase Alpha TestNet! Your wallet should look like this:
Connect to Moonriver¶
Getting started with Moonriver is a straightforward process. All you have to do is click Switch Network and select Moonriver
And that is it, you now have MathWallet connected to Moonriver! Your wallet should look like this:
Adding a Wallet¶
The following steps will show you how to interact with the Moonbase Alpha TestNet, but can also be used to interact with Moonriver.
After you are connected to Moonbase Alpha, you can now create a wallet to get an account and start interacting with the TestNet. Currently, there are three ways to add a wallet:
- Create a wallet
- Import an existing wallet using a mnemonic or private key
- Connect hardware wallet (not supported for now)
Create a wallet¶
The following steps for creating a wallet can be modified for Moonriver
To create a new wallet, click the sign next to "Moonbase Alpha" and select "Create Wallet".
Set and confirm a wallet name. Next, make sure you safely store the mnemonic, as it provides direct access to your funds. Once you have completed the process, you should see your newly created wallet with its associated public address.
Import a wallet¶
To create a new wallet, click the sign next to "Moonbase Alpha" and select "Import Wallet".
Next, select between importing using a mnemonic or a private key. For the first option, enter the mnemonic word by word, separated by spaces. For the second option, enter the private key (either with the
0x prefix or not, it works both ways).
After clicking next, set a wallet name, and that is it! You should see your imported wallet with its associated public address.
MathWallet serves as a Web3 provider in tools such as Remix. By having MathWallet connected to Moonbase Alpha or Moonriver, you can deploy contracts as you would like using MetaMask, signing the transactions with MathWallet instead.
For example, in Remix, when deploying a smart contract to Moonbase Alpha, make sure you select the "Injected Web3" option in the "Environment" menu. If you have MathWallet connected, you will see the TestNet chain ID just below the box (1287) and your MathWallet account injected into Remix as well. When sending a transaction, you should see a similar pop-up from MathWallet:
By clicking on "Accept," you are signing this transaction, and the contract will be deployed to the Moonbase Alpha TestNet.