From 2f91f20a8645339385ada602684f4957f20f4da4 Mon Sep 17 00:00:00 2001 From: jloup Date: Thu, 22 Feb 2018 11:31:59 +0100 Subject: Poloniex connection. --- cmd/web/Makefile | 19 +- cmd/web/js/api.js | 11 + cmd/web/js/main.jsx | 41 +- cmd/web/js/otp.jsx | 6 +- cmd/web/js/poloniex.jsx | 176 +++++- cmd/web/js/signin.jsx | 4 +- cmd/web/js/signup.jsx | 4 +- cmd/web/static/cryptocoins.css | 1150 ++++++++++++++++++++++++++++++++++++++ cmd/web/static/cryptocoins.ttf | Bin 0 -> 96448 bytes cmd/web/static/cryptocoins.woff | Bin 0 -> 58768 bytes cmd/web/static/cryptocoins.woff2 | Bin 0 -> 49976 bytes cmd/web/static/index.html | 1 + cmd/web/static/style.css | 15 +- 13 files changed, 1361 insertions(+), 66 deletions(-) create mode 100644 cmd/web/static/cryptocoins.css create mode 100644 cmd/web/static/cryptocoins.ttf create mode 100644 cmd/web/static/cryptocoins.woff create mode 100644 cmd/web/static/cryptocoins.woff2 (limited to 'cmd/web') diff --git a/cmd/web/Makefile b/cmd/web/Makefile index 1d98085..2ebb734 100644 --- a/cmd/web/Makefile +++ b/cmd/web/Makefile @@ -6,6 +6,7 @@ SRC_DIR=js BUILD_DIR=build/js JSX_SRC= main.jsx signup.jsx signin.jsx otp.jsx poloniex.jsx JS_SRC= cookies.js app.js api.js +STATIC_FILES= index.html style.css cryptocoins.css cryptocoins.ttf cryptocoins.woff cryptocoins.woff2 JSX_OBJS=$(addprefix $(BUILD_DIR)/,$(JSX_SRC:.jsx=.js)) JS_OBJS=$(addprefix $(BUILD_DIR)/,$(JS_SRC)) STATIC_BUILD_DIR=build/static @@ -16,18 +17,18 @@ install: yarn --version yarn install -static: js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css +static: $(STATIC_BUILD_DIR) js $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) js: build/static/main.js -$(STATIC_BUILD_DIR)/index.html: static/index.html - cp static/index.html $@ +$(STATIC_BUILD_DIR)/%: static/% + cp $< $@ -$(STATIC_BUILD_DIR)/style.css: static/style.css - cp static/style.css $@ +$(STATIC_BUILD_DIR): + mkdir -p $(BUILD_DIR) + mkdir -p $@ $(BUILD_DIR)/%.js: $(SRC_DIR)/%.jsx - mkdir -p $(@D) jscs --fix $< babel $< -o $@ jshint $@ @@ -42,11 +43,11 @@ build/static/main.js: $(JSX_OBJS) $(JS_OBJS) env/$(ENV).env -t [ debowerify ] \ $(BUILD_DIR)/main.js -o $@ -build/webapp.tar.gz: $(STATIC_BUILD_DIR)/main.js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css +build/webapp.tar.gz: $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) build/static/main.js tar czf $@ --directory=$(dir $<) $(notdir $^) -release: build/webapp.tar.gz +release: $(STATIC_BUILD_DIR) build/webapp.tar.gz clean: rm -rf build - rm -rf node_modules \ No newline at end of file + rm -rf node_modules diff --git a/cmd/web/js/api.js b/cmd/web/js/api.js index e2acd1d..5c19fdf 100644 --- a/cmd/web/js/api.js +++ b/cmd/web/js/api.js @@ -53,6 +53,17 @@ var ApiEndpoints = { return '/market/' + params.name; } }, + 'MARKET_BALANCE': { + 'type': 'GET', + 'auth': true, + 'parameters': [ + {'name': 'name', 'mandatory': true, 'inquery': false}, + {'name': 'currency', 'mandatory': true, 'inquery': true}, + ], + 'buildUrl': function(params) { + return '/market/' + params.name + '/balance'; + } + }, 'UPDATE_MARKET': { 'type': 'POST', 'auth': true, diff --git a/cmd/web/js/main.jsx b/cmd/web/js/main.jsx index eb53057..e5e505d 100644 --- a/cmd/web/js/main.jsx +++ b/cmd/web/js/main.jsx @@ -1,15 +1,17 @@ -var SignupForm = require('./signup.js').SignupForm; -var SigninForm = require('./signin.js').SigninForm; -var OtpEnrollForm = require('./otp.js').OtpEnrollForm; -var PoloniexForm = require('./poloniex.js').PoloniexForm; -var App = require('./app.js'); -var Api = require('./api.js').Api; -var cookies = require('./cookies.js'); +var SignupForm = require('./signup.js').SignupForm; +var SigninForm = require('./signin.js').SigninForm; +var OtpEnrollForm = require('./otp.js').OtpEnrollForm; +var PoloniexController = require('./poloniex.js').PoloniexController; +var App = require('./app.js'); +var Api = require('./api.js').Api; +var cookies = require('./cookies.js'); var Logo = React.createClass({ render: function() { - return (