This project is a Deno application that interacts with the Bitvavo API to fetch balance and price information for cryptocurrencies. It also provides a WebSocket server to send this information to connected clients.
-
Clone the repository:
git clone https://github.com/MBeggiato/bitvavo.git cd bitvavo
-
Install Deno:
Follow the instructions on the Deno Website to install Deno2. -
Create a
.env
file:
Copy the.env.template
file and rename it to.env
, then fill in your Bitvavo API key and secret. You can find instructions on how to create API keys here. -
Run the project:
deno install deno task dev
-
Access the REST API:
In your browser, you can now accesshttp://localhost:8000
.
API Endpoints
The application provides the following API endpoints:- GET /api/balance: Returns the balance.
- GET /api/price: Returns the price.
- GET /api/total: Returns the total value (balance * price).
- GET /api/all: Returns the balance, price, and total value.
WebSocket
The application also provides a WebSocket server. When a client connects, it will receive balance and price updates every second.
You can also run this project inside a Docker container with the following compose file (provided in the repo):
services:
deno-app:
image: ghcr.io/mbeggiato/bitvavo:latest
ports:
- "8000:8000"
env_file:
- .env
command: [ "run", "--allow-net", "--allow-env", "--allow-read", "--allow-sys", "main.ts" ]
To turn on detailed logging, add DEBUG=true
to your .env
file.
If you want to support my work, register using my link*. Thank you!
- this gives me a bonus and you can trade up to €10,000 in cryptocurrencies without fees in the first week.