It's a minimal CLI tool that connects to the ethereum, and bitcoin blochains as well as the Kraken Exchange.
Here are some of the things you could do with this tool:
- Register 1 or more BTC Addresses
- Register 1 or more ETH Addresses
- Register a Kraken API key with its associated private key
Note that registration here entails submitting the above listed data and having the CLI tool persist those data. I used the SQLite3 DB for data persistence. Pardon the deviation :))
Speaking of features:
- Get the baalances of all the BTC addresses at a go: Here the balance is returned in BTC and one of 5 Fiat Currencies(USD, EUR, NGN, CNY, JPY). The user gets to pick whichever currency they want
- Get the balances of all the ETH addresses at a go: same impplementation as the previous one.
- Retrieve the balances of a Kranken account given its private key and associated api-key.
Note that for quering the ethereum blochain, you could either go with a hosted provider or local node. More on this shortly.
To set this project up locally and test it out follow the following steps:
- Clone this repo to your local machine
- Create a virtual env for the project
- Navigate to the project's root directory and install all the dependencies
pip install requirements.txt
- For Ethereum queries, if you'd rather have the system query your local node, update the
PROVIDER_URL
environment variable in the.env
file to your local node's IPC's path and setIS_LOCAL_NODE
toTrue
Being a CLI program, you can only access the features of this project via the command line.
You do that by navigating to the project's root directory. In the root directory, run some commands that would then trigger certain
actions by the system. All commands are preceeded by python main.py
.
The very first step you need to take is runnning the command that would setup a local sqlite database with all the required tables.
- Run the command
python main.py setup-db
- Run the command
python main.py add-adrs-btc addrs1 addrs2 ... addrs-n
- Run the command
python main.py add-adrs-eth addrs1 addrs2 ... addrs-n
- Run the command
python main.py add-kraken-keys
- The user will then be prompted to type in their api, and private keys
All the above inputs are then saved in the sqlite database that has been setup in the first step.
- Run the command
python main.py display-balance-btc
- The user will then be prompted to pick the fiat currency they'd want the system to show their fiat balance in
- Run the command
python main.py display-balance-eth
- The user will be prompted again for currency
- Run the command
python main.py display-balance-kranken
- Run the command
python main.py -h
- This will show a list of all the available commands. Sadly, I haven't added descriptions for the commands. It's meant to serve as a list that you could always refer to
- Python 3.8
- Asyncio $ aiohttp for making async requests
- Web3.py - for the ethereum stuff
- sqlite3
- Black and Isort - for linting
- External APIs:
- Infura-- Web3.py Hosted provider
- Kranken-- for the kranken stuff lol
- Exchange-currency-- for getting btc to dollar rate, for example
- BlockCypher-- fot eh bitcoin stuff