Skip to content

Basic REST / Websocket project to read data from the Bitvavo API.

Notifications You must be signed in to change notification settings

MBeggiato/bitvavo

Repository files navigation

WorkflowDynamic JSON Badge

Bitvavo

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.

Run localy

  1. Clone the repository:

    git clone https://github.com/MBeggiato/bitvavo.git
    cd bitvavo
  2. Install Deno:
    Follow the instructions on the Deno Website to install Deno2.

  3. 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.

  4. Run the project:

    deno install
    deno task dev
  5. Access the REST API:
    In your browser, you can now access http://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.

Run as container

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" ]

Other

To turn on detailed logging, add DEBUG=true to your .env file.

Don't have a Bitvavo account yet?

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.

About

Basic REST / Websocket project to read data from the Bitvavo API.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages