# Using MetaMask

## What is MetaMask

From the MetaMask website, MetaMask is a crypto wallet and gateway to blockchain apps. It is available as a browser extension and as a mobile app, Metamask equips you with a key vault, secure login, token wallet, and token exchange - everything you need to manage your digital assets. MetaMask was created out of the need of creating more secure and usable Ethereum-based websites. In particular, it handles account management and connecting the user to the blockchain.

You can learn more about MetaMask from the official website metamask.io and from this [video](https://www.youtube.com/watch?v=YVgfHZMFFFQ\&feature=youtu.be)

To use Xend finance, which is a decentralized application (dApp), the Xend finance website needs to be connected to MetaMask, and since MetaMask is also a web browser extension this connection is quite straightforward to accomplish.

## Set-up MetaMask

### Mobile Device

To use Xend Finance from your mobile phone, you need to download the MetaMask mobile app. Go to Play Store or Apple Store and search for the MetaMask and download.

![MetaMask welcome screen](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MVvPXIMZKPmlEwt9q_X%2F-MVvT7tXjNFPTdR8cEZh%2Fwelcome-metamask.jpg?alt=media\&token=ae1514ab-264b-43fe-8329-459fc2221a62)

Next, follow the steps on the app to set up your wallet. You can import your already existing address using your address seed phrases, you can sync your MetaMask wallet if you already set up MetaMask on your computer, or you can just create a new wallet. Choose one of these options and complete the remaining steps to finish the setup of MetaMask on your device.

![MetaMask wallet home screen](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MVvPXIMZKPmlEwt9q_X%2F-MVvXICmSfHuFlXBOp2k%2Fhome.jpg?alt=media\&token=7af7face-76fb-4efe-a013-e387a25c783d)

You should have a similar screen to the screenshot above.

**Add Binance Smart Chain Network**

By default, MetaMask does not usually come with the Binance Smart Chain network, and to make use of Xend Finance we have to run it on the Binance Smart Chain network.

Click the menu icon on the top left of the app, the side drawer opens and looks similar to the screenshot below.

![MetaMask side drawer](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MVvPXIMZKPmlEwt9q_X%2F-MVvZxOd4lEhTXKSlEf0%2Fsettings.jpg?alt=media\&token=62e1ea7c-906f-423b-9d6e-887ae94fdbbb)

Click the "**Settings**" options, and choose the Network options from the list of options that shows up.&#x20;

![List of Networks on MetaMask](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MVvPXIMZKPmlEwt9q_X%2F-MVvbdDh3gnimWwM3sk5%2Fnetworks.jpg?alt=media\&token=231e5b63-524d-4205-881d-3fce6adbe311)

Click the **Add Network** button at the bottom of the page and input the values for the Binance Smart Chain network.

![Adding Binance Smart Chain network values](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MVvPXIMZKPmlEwt9q_X%2F-MVvdGkVTeIJgKuVmDmL%2Fbsc-mainnet.jpg?alt=media\&token=fe3e3ddc-705c-45e2-a8cb-b7f20e0584d8)

Once you save the network, you will be able to open Xend Finance on the MetaMask mobile app.

Click the menu icon at the top left of the screen, and select the browser option and search [bsc.xend.finance](https://bsc.xend.finance/) from the search bar.&#x20;

![Xend Finance](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MVvPXIMZKPmlEwt9q_X%2F-MVvforJ2bWrX8osF0_n%2Fxendfinance.jpg?alt=media\&token=17c9f0f6-b65e-4dec-a2dc-f9ae1d7f2c27)

###

### Web Browser

Open the MetaMask download page <https://metamask.io/download.html> and install the browser extension/plugin if your browser is a supported browser. MetaMask works on browsers like Google Chrome, Firefox, Brave, Microsoft Edge, etc.

When downloading and installation complete, a welcome page similar to the image below should open. Click the **Get Started** button

![Welcome to MetaMask](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MOQ7gQuHKJ3FcjvB0lT%2F-MOQ9i8o1Yy7w1M45_u6%2F1.png?alt=media\&token=051929ef-3e84-446b-b9d6-4c5bd022f498)

###

Next, you can choose to import an already existing wallet or you can set up a new wallet. If this is your first time using MetaMask, you can just create a wallet. I am continuing with the assumption that you are creating a new wallet. Click the **Create a Wallet** button to continue.

![Create a new wallet](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MOQ7gQuHKJ3FcjvB0lT%2F-MOQ9i8rsqhOwoJSpN9W%2F2.png?alt=media\&token=a6571077-7c80-4744-bb9a-3982f370b085)

**You can go through the route of import your already existing wallet.**

### Create a new wallet

Type your password and create a wallet

![Type in password and create wallet](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MOQBMNXk8vc5_CUmfdi%2F-MOQMGxwRMjEBl7Oympk%2Fezgif.com-optimize.gif?alt=media\&token=d8bcf600-e962-43f4-b5c6-42d621aea513)

Follow the steps that come after and save the secret seed phrase that will help in retrieving your account whenever you need it. If everything goes successfully you should see the congratulations page like the screenshot below.

![Wallet successfully created](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MOQMixN6_OMd0oNJ5jb%2F-MOQO9Ov9zrAGutCGbHB%2F3.png?alt=media\&token=fa61ec46-7df6-49f3-b61f-265a702078b6)

If all went well with the processes above, you should see your new wallet on MetaMask like the screenshot below.

![New wallet created](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MOQOIB79iKpSBnsLKdu%2F-MOQOq-j1cJkZ5fPrlDi%2F4.png?alt=media\&token=6cbf74c5-c578-4fff-b055-821f3f711b7f)

You are now set to start using Xend Finance with MetaMask :)&#x20;

## Adding a Network

### Network Details

{% tabs %}
{% tab title="Binance Smart Chain Mainnet" %}
Binance Smart Chain (BSC) is best described as a blockchain that runs in parallel to the Binance Chain. Because BSC is EVM-compatible, it launched with support for the rich universe of Ethereum tools and DApps. This version of Xend Finance is running on the Binance Smart Chain network because of its interoperability, fast throughput, high security, and its on-chain governance.

| Field              | Value                               |
| ------------------ | ----------------------------------- |
| Network Name       | Binance Smart Chain                 |
| New RPC URL        | <https://bsc-dataseed.binance.org/> |
| Chain ID           | 56                                  |
| Symbol             | BNB                                 |
| Block Explorer URL | <https://bscscan.com>               |
| {% endtab %}       |                                     |

{% tab title="Testnet - Binance Smart Chain" %}
Binance Smart Chain (BSC) is best described as a blockchain that runs in parallel to the Binance Chain. Because BSC is EVM-compatible, it launched with support for the rich universe of Ethereum tools and DApps. This version of Xend Finance is running on the Binance Smart Chain network because of its interoperability, fast throughput, high security, and its on-chain governance.

| Field              | Value                                             |
| ------------------ | ------------------------------------------------- |
| Network Name       | BSC Testnet                                       |
| New RPC URL        | <https://data-seed-prebsc-1-s1.binance.org:8545/> |
| Chain ID           | 97                                                |
| Symbol             | BNB                                               |
| Block Explorer URL | <https://testnet.bscscan.com>                     |
| {% endtab %}       |                                                   |
| {% endtabs %}      |                                                   |

### Add a network

Go to the settings page, click on Networks, and click on the "**Add Network**" button on options that opens up. These same steps apply to all other networks Xend Finance is deployed on like the Binance Smart Chain Mainnet.

![Add network option](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MORYzRQpQmuLsP0-m8g%2F-MORuSX-HsciuDccHzpQ%2Fadd-network.gif?alt=media\&token=08fc5778-182c-41c0-85d3-1770e166ab8d)

Fill the form that opens up with the following details and click the save button.

![Fill new network form](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MORYzRQpQmuLsP0-m8g%2F-MORw1VChqoTYXXZdtsN%2F5.png?alt=media\&token=ad6ad77a-508f-438b-a7d6-447de9f6510d)

## Connect Xend Finance with MetaMask

If you have successfully saved the network, it should be among the list of networks on MetaMask, make sure Binance Smart Chain is the selected network from the list.

![Added Binance Network](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MORwFLjptn1SM2x4zl9%2F-MOS4SSzke1-9A1Pk8GA%2Fbsc.gif?alt=media\&token=3f42a6d4-c18e-42e7-8ac8-f85ccff86642)

Now to connect the Xend Finance website with MetaMask, while you are on the Xend Finance home page [https://bsc.xend.finance/ ](https://bsc.xend.finance/)or <https://testnet.xend.finance/>, depending on the network you want to invest with, then, click on the MetaMask extension

![Connect Xend Finance to MetaMask](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MOSopEd2ytlWYnuwB8z%2F-MOSzhE2ZjNlfujO829F%2Fconnect-app.gif?alt=media\&token=96d5a517-c3db-4c1b-8c99-702aca07ab64)

After connecting to MetaMask, there could be situations where MetaMask brings up the connection modal that will look similar to the screenshot below. Select your account and proceed.

![MetaMask connect notification modal](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MOSopEd2ytlWYnuwB8z%2F-MOT1oGqpwvIOk4msCgL%2F17.png?alt=media\&token=a7b0d080-aaea-4d91-b191-01160774f625)

![MetaMask connect notification modal](https://2816221107-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOBLjVoiVm5YWOGz5Av%2F-MOSopEd2ytlWYnuwB8z%2F-MOT1wPoOdLwSD2YzKT-%2F18.png?alt=media\&token=2728f9e9-045c-4201-ba9a-eb92a41219b0)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xend.finance/metamask.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
