This Project is a Student Project for the course "Computer Networks" at Hanyang University, Seoul, South Korea. The project is for education purpose. It may contain errors It is not intended for professional use.
This repository contains demo code for interacting with the Kraken API, with examples to check account balance and place sell orders. It aims to introduce to encryption keys and HTTP protocol, sending a properly formatted packet.
The project is divided into two parts, one in python the other in C++. The 2 project's codes do (mostly) the same things:
- CryptoAPI_PY: A Python project
- CryptoAPI_CPP_CMake: A C++ project using CMake to build the project. Developed in Visual Studio 2022, compatible with Linux/macOS.
This repository demonstrates how to interact with the Kraken cryptocurrency exchange API to:
- Check account balance.
- Place a sell order.
- Test the limit rate of the API only in Python.
The code is provided in Two different programming language:
- A Python version.
- A C++ version using CMake.
git clone https://github.com/TheHardy04/CryptoAPI.git
cd CryptoAPI
Create a Kraken account on Kraken's website (no need to check ID)
Create your API Key in your account's settings choosing the options :
- Query funds
- Create and modify orders
(Those are the permissions you need to run the demo code)
- Windows
set KRAKEN_API_KEY="YourPublicAPIKey"
set KRAKEN_API_SECRET="YourPrivateAPIKey"
- Linux/MacOS
export KRAKEN_API_KEY="YourPublicAPIKey"
export KRAKEN_API_SECRET="YourPrivateAPIKey"
- Python 3.10 or higher installed on your system.
cd CryptoAPI_PY
python main.py
You can test the limits of the API operations by adding rate
or test
as an argument when running the code :
cd CryptoAPI_PY
python main.py rate
- Windows OS
- Visual Studio with C++ and Cmake development environment set up.
- Open Visual Studio and load the project directory. Visual Studio should automatically detect the
CmakeList.txt
file and start configure the project - Run the project from Visual Studio pressing F5 (or selecting Debug > Start Debugging).
- CMake installed on your system.
- GCC/Clang for Linux/macOS.
- Debian/Ubuntu
sudo apt update
sudo apt install libcurl4-openssl-dev libssl-dev
- Fedora
sudo dnf install libcurl-devel openssl-devel
- MacOS
brew install curl openssl
- Navigate to the CryptoAPI_CPP_CMake folder:
cd CryptoAPI_CPP_CMAKE
- Create a
build
directory and navigate to it
mkdir build && cd build
- Run CMake to configure the project:
cmake ..
- Build the project
make
- Run the executable
./CryptoAPI_CPP
- Hanyang University
- Profesor : 원영준