Skip to content

Latest commit

 

History

History
493 lines (334 loc) · 10.2 KB

README.md

File metadata and controls

493 lines (334 loc) · 10.2 KB

hodl-invest

https://hodl-invest.herokuapp.com/

https://hodl-invest-server.herokuapp.com/

Official release video: https://www.youtube.com/watch?v=WTd5bk7xgIg&feature=youtu.be

Gitter chat

Description:

Hodl Invest is a mock crypto currency exchange simulator where users can use play money to buy and sell virtual bitcoins and see how well they did if they actually made the decision on the real cryptocurrency exchange. Our mission is to make it easier and less daunting for people to get into cryptocurrencies while also creating a fun and interactive experience for intermediate cryptocurrency traders who are interested in testing their investment strategies.

Minimum Viable Product:

Users would be able to login to our platform to perform buying and selling virtual bitcoins transactions with play money as well as checking their history of transactions.

Users would be able to:

    1. see interactive graphs
    2. have play money
    3. buy and sell virtual bitcoins
    4. check user transactions history
    5. authenticate through proprietary login

Add Ons:

    1. There will be a highscores where users can see who the best performing users are.
    2. There will be support for more multiple virtual cryptocurrencies.
    3. Users will be able to refer friends and get additional virtual play money.
    4. Transactions would account for transaction fees on the cryptocurrencies.
    5. Rewards for daily consecutive logins for an entire week.
    6. Tournaments that people could join for a fee and the winner gets some reward.

User Stories:

    1. As a user, I want to be able to buy and sell virtual bitcoins so that I can learn more about the real cryptocurrency market through a real-life stimulator and have better understanding of my investment strategy.
    2. As a user, I want to be able to see a history of my transactions so that I can see how well my investment strategies are working and create new strategies to adjust the market.
    3. As a user, I want to be able to check the current portfolio so that I can see at a glance of the total value of my portfolio.

hodl-invest server API documentation https://hodl-invest-server.herokuapp.com/

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
 if (this.readyState === 4) {
   console.log(this.responseText);
 }
});

xhr.open("GET", "https://hodl-invest-server.herokuapp.com/api/v1/users/");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(null);
  • Method:

    POST

  • URL Params

    Required:

  • Data Params

    Required:

    username=[string] password=[string] name=[string] email=[string]

  • Sample Call:

var data = JSON.stringify({
  "username": "user",
  "name": "tyler",
  "email": "email@email.com",
  "password": "password"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://hodl-invest-server.herokuapp.com/api/v1/users/");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Cache-Control", "no-cache");

xhr.send(data);
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://hodl-invest-server.herokuapp.com/api/v1/users/zoro");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Cache-Control", "no-cache");

xhr.send(data);
  • Returns JSON:
{
    "username": "zoro",
    "name": "kenny",
    "playMoney": 76909.33368264533,
    "transactions": [
        {
            "cryptocoin": {
                "ticker": "btc",
                "price": 6543
            },
            "amount": 5,
            "transactionType": "BUY",
            "timestamp": "2018-04-12T18:45:49.741"
        },
        {
            "cryptocoin": {
                "ticker": "eth",
                "price": 525
            },
            "amount": 3,
            "transactionType": "SELL",
            "timestamp": "2018-04-12T18:45:49.741"
        },
        {
            "cryptocoin": {
                "ticker": "BTC",
                "price": 7696.888772451555
            },
            "amount": 3,
            "transactionType": "BUY",
            "timestamp": "2018-04-12T19:02:54.113"
        }
    ],
    "portfolio": {
        "BTC": 3
    }
}
  • Method: DELETE

  • URL Params

    Required:

    username=[string]

  • Data Params

    Required:

    token=[string]

  • Sample Call:

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://hodl-invest-server.herokuapp.com/api/v1/users/ninja");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(data);
   [
    {
        "cryptocoin": {
            "ticker": "btc",
            "price": 6543
        },
        "amount": 5,
        "transactionType": "BUY",
        "timestamp": "2018-04-12T18:45:49.741"
    },
    {
        "cryptocoin": {
            "ticker": "eth",
            "price": 525
        },
        "amount": 3,
        "transactionType": "SELL",
        "timestamp": "2018-04-12T18:45:49.741"
    }
]
var data = JSON.stringify({
  "username": "zoro",
  "password": "fakepassword"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://hodl-invest-server.herokuapp.com/api/v1/users/login");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(data);
  • Returns JSON:
   {
    "token": "bS30Kkpbwj8rvUXtWVZzOKzWGoJjyatLVF17397vNW329gY6wdqJDdlj8BrNhif3",
    "username": "zoro"
}
var data = JSON.stringify({
  "token": "id8qGYO1ClxCIBqZNfUTX9W5EzKgzWJ8unCXcbN3iuTh2qRPTNcYACk2GJKHdkOV"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://hodl-invest-server.herokuapp.com/api/v1/users/logout");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(data);
var data = JSON.stringify({
  "token": "sBaDqq91QKYfPSILejlE7mlHttqbykbT2EgVZJrGqwroyci9rJRaBvW4WomKBXaD",
  "username": "user"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://hodl-invest-server.herokuapp.com/api/v1/users/buy/xrp/500");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Cache-Control", "no-cache");

xhr.send(data);
var data = JSON.stringify({
  "token": "sBaDqq91QKYfPSILejlE7mlHttqbykbT2EgVZJrGqwroyci9rJRaBvW4WomKBXaD",
  "username": "user"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://hodl-invest-server.herokuapp.com/api/v1/users/sell/xrp/500");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Cache-Control", "no-cache");

xhr.send(data);
var data = null;

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://hodl-invest-server.herokuapp.com/api/v1/cryptocoins/BTC");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.setRequestHeader("Postman-Token", "daead1f1-6344-42b5-89dc-92981df21b62");

xhr.send(data);