Sign inSign up

pcherepanov55/crypto-widget

By pcherepanov55

•Updated 7 months ago

Crypto portfolio widget backend for Homepage dashboard (gethomepage.dev)

Image
Networking
Web servers
0

1.5K

pcherepanov55/crypto-widget repository overview

⁠Crypto Widget for Homepage

A lightweight Java microservice that aggregates cryptocurrency wallet balances and serves them as a JSON API for the Homepage⁠ Custom API widget.

⁠Features

  • Fetches BTC and ETH wallet balances from public blockchain APIs
  • Converts balances to USD using CoinGecko
  • Converts total to RUB using Central Bank of Russia rates
  • Supports multiple wallet addresses per coin (balances are summed)
  • Supports static balances (e.g. for staked assets)
  • 5-minute cache to avoid excessive API calls
  • No API keys required

⁠Quick Start

docker run -d --name crypto-widget -p 8085:8085 \
  -e CRYPTO_WALLETS_BTC=your_btc_address \
  -e CRYPTO_WALLETS_ETH=0xyour_eth_address \
  -e CRYPTO_STATIC_ETH=2.5 \
  pcherepanov55/crypto-widget:latest

⁠Environment Variables

VariableDescription
CRYPTO_WALLETS_BTCBTC addresses (comma-separated)
CRYPTO_WALLETS_ETHETH addresses (comma-separated)
CRYPTO_STATIC_BTCStatic BTC amount to add (e.g. staked)
CRYPTO_STATIC_ETHStatic ETH amount to add (e.g. staked)
ETH_RPC_URLCustom Ethereum RPC endpoint (optional)

⁠Homepage services.yaml

- Crypto:
    - Crypto Portfolio:
        widget:
          type: customapi
          url: http://<host>:8085/api/portfolio
          refreshInterval: 300000
          display: block
          mappings:
            - field: btc
              label: BTC
            - field: eth
              label: ETH
            - field: totalUsd
              label: Total USD
            - field: totalRub
              label: Total RUB

⁠API Response Example

GET /api/portfolio
{
  "btc": "0.50000000 BTC ($32,500.00)",
  "eth": "10.000000 ETH ($25,000.00)",
  "totalUsd": "$57,500.00",
  "totalRub": "5,290,000 ₽"
}

Tag summary

Content type

Image

Digest

sha256:119365797…

Size

108.6 MB

Last updated

7 months ago

docker pull pcherepanov55/crypto-widget