Coder Social home page Coder Social logo

cryptowallettracker's Introduction

CryptoWalletTracker

CryptoWalletTracker is a Node.js application for tracking cryptocurrency wallet balances and their historical changes.

Table of Contents

Introduction

CryptoWalletTracker allows you to fetch and store cryptocurrency wallet balances from various sources, such as BSCScan. It periodically updates the balances and tracks their daily and weekly percentage changes. This application is useful for monitoring your cryptocurrency holdings over time.

Features

  • Fetches cryptocurrency wallet balances from BSCScan API.
  • Stores wallet addresses and their balances in a MongoDB database.
  • Periodically updates wallet balances and tracks historical changes.
  • Provides API endpoints to retrieve the latest balance and percentage changes.

Installation

  1. Clone the repository:
git clone https://github.com/IamAbishan1/CryptoWalletTracker.git
  1. Install dependencies
cd CryptoWalletTracker
npm install
  1. Create .env file with and declare following variables
   PORT=8000 
   MONGO_URL="YOUR_MONGO_URI"
   BSCSCAN_API_KEY="YOUR_BSCSCAN_API_KEY"
  1. Seed data
npm run seed
  1. Start cron
npm run cron
  1. Start the server:
npm start

Usage

  1. Ensure the application is running by executing
npm start
  1. Seed the data by executing
npm run seed
  1. Start the cron-job by executing
npm run cron
  1. Get the swagger documentation by executing
npm run swagger-autogen
  1. Use the provided API endpoints to interact with the application.

Project Structure

The project follows a standard structure to organize its components:

CryptoWalletTracker/
├── src/
│   ├── config/
│   │   └── db.js                    # Database configuration
│   ├── models/
│   │   ├── balanceHistory.model.js  # MongoDB schema for balance history
│   │   └── wallet.model.js          # MongoDB schema for wallet
│   ├── scripts/
│   │   ├── seed.js                   # Script for seeding the database
│   │   ├── seedData.js               # Seed data for database population
│   │   ├── seedWallet.js             # Script for seeding wallet data
│   │   └── swagger.js                # Script for swagger documentation of endpoints
│   ├── services/
│   │   └── walletService.js         # Business logic and data processing for wallets
│   ├── utils/
│   │   ├── errorCatch.js            # Error handling utility
│   │   └── validator.js             # Validation utility
│   ├── v1/
│   │   ├── controller/
│   │   │   └── wallet.controller.js # Controller for wallet-related operations
│   │   ├── helper/              # Helper functions for controllers
│   │   │   ├── helper.js        # Helper functions
│   │   │   └── validator.js     # Validation functions
│   │   ├── middleware/              # Middleware for v1 routes
│   │   └── routes/                   # Routes for v1 API endpoints
│   │      ├── index.route.js        # Index route
│   │      └── wallet.route.js       # Wallet route
│   └── main.route.js                # Main route file for application entry point  
├──  test/
├── .env                             # Environment variables file
├── .env.example                     # Example environment variables file
├── .gitignore                       # Gitignore file
├── compose.yml                      # Docker Compose configuration file
├── Dockerfile                       # Docker configuration file
├── Jenkinsfile                      # Jenkins pipeline configuration file
├── README.md                        # README file
├── package.json                     # NPM package configuration file
└── server.js                        # Main server file

Endpoints

Fetch wallet

GET /api/v1/wallet/: Get all wallet with latest balance along with daily, weekly and monthly balance changed in percent

GET /api/v1/wallet?wAddress=walletAddress: Get a wallet with latest balance along with daily, weekly and monthly balance changed in percent

GET /api/v1/wallet?date=yyyy/mm/day: Get wallets with latest balance along with daily, weekly and monthly balance changed in percent with respective to given time

GET /api/v1/wallet?wAddress=walletAddress&date=yyyy/mm/day: Get a wallet with latest balance along with daily, weekly and monthly balance changed in percent with respective to given time

Test

npm test

cryptowallettracker's People

Contributors

iamabishan1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.