Simplifying blockchain interaction for everyone!
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Important Links:
Note - You must provide an Openai API key on the website, for the chatbot to operate successfully!
Table of Contents
MxAI is a user-friendly chatbot designed to simplify and democratize blockchain technology. It reduces the steep learning curve for newcomers by providing an AI-driven interface that requires minimal technical expertise, while also streamlining repetitive and time-consuming processes for technical users. Our chatbot aims to make web3 accessible to everyone, contributing to the widespread adoption of blockchain technology.
Current features include:
- Generate, compile, and deploy code for blockchain applications
- Interact with ERC20 contracts
- Perform operations such as sending tokens and viewing balances of accounts
- Lookup Multiversx Documentation for guidance and information
We have used the following MultiversX sdks to build the project:
- sdk-js
- The wallet extension provider enables users to authenticate their MultiversX DeFi Wallet and authorize transactions.
- Network providers to interact with the network and broadcast the transactions.
- Utilized Code, SmartContract, and CodeMetadata classes to deploy smart contracts from hosted .wasm files.
- ABI Registry to interact with smart contracts from hosted abi files.
- sdk-py
- Query details about accounts such as balance, nonce etc.
- mx-sdk-rs
- Use the library to compile the generated contracts
- Multiversx Defi Wallet Extension
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
- Python (For Backend)
- Rust including cargo (For Backend)
-
Set up Supabase:
-
Visit Supabase and sign up for an account if you don’t already have one.
-
After signing up and logging in, create a new project.
-
Once your project is created, navigate to the 'API' section. Here, you will find your API keys:
supabaseUrl
andanonKey
. -
Note down these keys. You'll be needing them in subsequent steps.
-
-
Clone the Repository:
-
Open your terminal or command prompt and execute the following commands:
git clone https://github.com/CommanderAstern/encode-multiversX.git
-
This will clone the repository into a directory named "encode-multiversX".
-
-
Install Necessary NPM Packages:
-
Configure Environment Variables:
-
In the
frontend
directory, create an.env.local
file. -
Open
.env.local
in a text editor. -
Add the following environment variables with the values that you obtained from the Supabase dashboard:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
Replace
your_supabase_url
andyour_anon_key
with the appropriate values. -
Specify Your Backend's URL:
Specify the URL where your backend is currently running.
Open the
.env.local
file and add the following:NEXT_PUBLIC_BASE_URL=http://localhost:5000
In the above example, the backend is assumed to be running locally on port
5000
. Replacehttp://localhost:5000
with the actual URL where your backend is running. -
Save and close the
.env.local
file.
-
-
Run the Application:
If you're ready to see your project in action, you can start the development server:
npm run dev
Visit
http://localhost:3000
in your browser to see the application running.
To install the backend, follow the steps below:
- Go to the backend directory
cd backend
- Create an env file and add the following variables
cp env.example .env
- Install the requirements
pip install -r requirements.txt
- Install Rust Mx Library
cargo install multiversx-sc-meta
- Run the backend using gunicon
gunicorn app:app -w 3 --timeout 120
-
Create an Account
- Open your web browser and navigate to:
http://mxai.live/signup
- Follow the on-screen instructions to create an account.
-
Configure OpenAI API Key
-
After logging in, look for a user icon or profile picture on the top right corner of the web page.
-
Click on it. A modal (popup window) will appear.
-
Within this modal, you'll find an input field to add your OpenAI API key. Paste your OpenAI API key into the designated field.
-
Save to ensure your key is stored.
-
-
Set Up MultiversX Wallet Extension
Before proceeding, ensure you have the MultiversX Wallet browser extension:
-
If you haven't installed the MultiversX Wallet extension, download and install it from the respective browser's extension store.
-
Once installed, click on the MultiversX Wallet icon in your browser's toolbar.
-
Log in or set up your wallet account.
-
-
Start Typing!
With everything set up, you're ready to interact with the application. Start typing in the designated area, and watch as the magic happens!
- I would like to send a transaction of 1000 to
wallet_address
- What is the balance of
wallet_address
? - Can you generate a contract that let's you add two numbers and also holds the number 8 which you can increment?
- Can you tell me about the extension wallet provider in multiversX?
- I'd like to interact with an ERC20 contract at address
contract_address
You can interact with the Backend API directly. You can use the following postman collection as a reference: Postman Collection
- Code generation, compilation and deployment
- Interact with contracts (ERC20 as of now)
- Send and view balances of accounts
- Lookup Multiversx Documentation
- Enable editing of generated code
- Improve code generation, expand training dataset
- Swap tokens using Ashswap
- Extend interaction to other contracts
- ERC721
- ERC1155
- Allow Interaction of all contracts given ABI
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Pratik Jallan - Linkedin - pratikjalan11@gmail.com
Malavika Harikumar - Linkedin - malavikaha02@gmail.com
Asim Jawahir - Linkedin - asimjawahir123@gmail.com