Interacting with Moonbeam Using MathWallet¶
In this tutorial, we'll go through how to setup MathWallet to connect to our TestNet. We'll also present a brief example of using MathWallet as a Web3 provider for other tools such as Remix.
Connect MathWallet to Moonbeam¶
In this part, we'll go through the process of connecting MathWallet to Moonbase Alpha.
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.
Next, let's 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:
Adding a Wallet¶
Now that MathWallet is connected to Moonbase Alpha, we 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¶
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, 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, 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.
We Want to Hear From You¶
If you have any feedback regarding using MathWallet or any other Moonbeam related topic, feel free to reach out through our official development Discord server.