This application is a simple Ethereum wallet that allows you to create a new Ethereum account, check the balance of an ERC20 token for a given Ethereum address, and fetch the market chart data for a given ERC20 contract.
- Python 3.6 or higher
- Flask
- Web3
- requests
You can install the necessary Python packages using pip:
pip install flask web3 requests
- Clone the repository and navigate to the project directory.
- Replace
'YOUR_INFURA_PROJECT_ID'
,'your-secret-key'
, and'YOUR_PASSWORD'
in the Python script with your actual Infura project ID, secret key, and password. - Run the application:
python app.py
- Open a web browser and navigate to
http://localhost:5000
.
GET /new_account
: Creates a new Ethereum account and returns the private key and address.GET /balance/<contract_address>
: Returns the balance of the ERC20 token for the Ethereum address stored in the session.POST /send_transaction
: Send Ether to other Ethereum addressesGET /market_chart/<contract_address>/<days>
: Returns the market chart data for the given ERC20 contract in USD for the specified number of days.
app.py
: The main Python script that runs the application.erc20_abi.json
: The ABI for the ERC20 token standard.templates/index.html
: The HTML template for the application's user interface.
For more details, please refer to the article published in the coingecko.