From 020f73417ef1261ec7e61b4a9f754d185f389034 Mon Sep 17 00:00:00 2001 From: Brendan Lane Date: Mon, 21 Dec 2020 01:07:12 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=BB=20Sync=20to=20local?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/Stock.ts | 16 ++++++++++++++++ src/modules/User.ts | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/modules/Stock.ts b/src/modules/Stock.ts index 181b1aa..f526a77 100644 --- a/src/modules/Stock.ts +++ b/src/modules/Stock.ts @@ -34,6 +34,22 @@ class Stock { }) }) } + + public async getBuyPrice (): Promise { + return await new Promise((resolve, reject) => { + axios.get(`${ecoURL}/getStockBuyPrice`, { + params: { + ticker: this.stockTicker + } + }) + .then((response) => { + resolve(response.data) + }) + .catch((error) => { + reject(error) + }) + }) + } } export default Stock diff --git a/src/modules/User.ts b/src/modules/User.ts index 8be1cab..c01d49e 100644 --- a/src/modules/User.ts +++ b/src/modules/User.ts @@ -8,6 +8,12 @@ import { ConfigUser } from './interfaces/Interfaces' const userURL = 'https://api.spookvooper.com/user' const ecoURL = 'https://api.spookvooper.com/eco' +const HasFossPP = [ + 'u-02c977bb-0a6c-4eb2-bfca-5e9101025aaf', + 'u-c44e159c-92ef-4e0a-b87f-020c8a4be1b4', + 'u-66acf505-9c08-4bce-9fec-2c9c7923cf22' +] + class User { private accountid: string private authkey: string @@ -240,6 +246,14 @@ class User { this.accountid = svid } + + public hasFossPp (): boolean { + if (HasFossPP.includes(this.accountid)) { + return true + } else { + return false + } + } } export default User