diff --git a/package-lock.json b/package-lock.json index d55cfbe..dd30fde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3441,9 +3441,9 @@ "dev": true }, "electron": { - "version": "6.1.5", - "resolved": "https://registry.npmjs.org/electron/-/electron-6.1.5.tgz", - "integrity": "sha512-PrdJKkAS0IaSJwu4him03VYqvAKK1qyWTE/ieb4LgcbR4F4u90b91/7xna6P1GpD/FXiHqzZQcs0SvK/o08ckQ==", + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/electron/-/electron-6.1.7.tgz", + "integrity": "sha512-QhBA/fcYJit2XJGkD2xEfxlWTtTaWYu7qkKVohtVWXpELFqkpel2DCDxet5BTo0qs8ukuZHxlQPnIonODnl2bw==", "dev": true, "requires": { "@types/node": "^10.12.18", @@ -3452,9 +3452,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.6.tgz", - "integrity": "sha512-0a2X6cgN3RdPBL2MIlR6Lt0KlM7fOFsutuXcdglcOq6WvLnYXgPQSh0Mx6tO1KCAE8MxbHSOSTWDoUxRq+l3DA==", + "version": "10.17.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.11.tgz", + "integrity": "sha512-dNd2pp8qTzzNLAs3O8nH3iU9DG9866KHq9L3ISPB7DOGERZN81nW/5/g/KzMJpCU8jrbCiMRBzV9/sCEdRosig==", "dev": true } } @@ -11481,14 +11481,14 @@ "dev": true }, "vue": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz", - "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==" + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.11.tgz", + "integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==" }, "vue-cli-plugin-electron-builder": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/vue-cli-plugin-electron-builder/-/vue-cli-plugin-electron-builder-1.4.3.tgz", - "integrity": "sha512-nPucf1iuEnCRbPNE1YaOPNXYM0JvPshtD73gVAfAz+jkvuhACqrDGoOLLdKtWiqDUubAy2JR/OXUTs96PTD3CQ==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/vue-cli-plugin-electron-builder/-/vue-cli-plugin-electron-builder-1.4.4.tgz", + "integrity": "sha512-g+x4uRMQQfYvfSTEwC4swRSRQOpEhV6cRx4kKus2b2MWz/4h1pfCqYwGdR9xLeaJdhfAH3c328feugnd6MIenQ==", "dev": true, "requires": { "chokidar": "^3.0.2", @@ -11544,19 +11544,19 @@ } }, "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", "dev": true, "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.1", + "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" + "readdirp": "~3.3.0" } }, "emoji-regex": { @@ -11657,12 +11657,12 @@ "dev": true }, "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", "dev": true, "requires": { - "picomatch": "^2.0.4" + "picomatch": "^2.0.7" } }, "string-width": { @@ -11776,9 +11776,9 @@ } }, "vue-template-compiler": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.10.tgz", - "integrity": "sha512-jVZkw4/I/HT5ZMvRnhv78okGusqe0+qH2A0Em0Cp8aq78+NK9TII263CDVz2QXZsIT+yyV/gZc/j/vlwa+Epyg==", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.11.tgz", + "integrity": "sha512-KIq15bvQDrcCjpGjrAhx4mUlyyHfdmTaoNfeoATHLAiWB+MU3cx4lOzMwrnUh9cCxy0Lt1T11hAFY6TQgroUAA==", "dev": true, "requires": { "de-indent": "^1.0.2", @@ -11792,9 +11792,9 @@ "dev": true }, "vuetify": { - "version": "2.1.13", - "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.1.13.tgz", - "integrity": "sha512-wy7RfNmRW60sPNRxl0C7TwRcLRw2Yw+ofGlJTAcoQZnWDtDOriSq0p3Uk8X0jb6tzkeU5Ed0JY6zL0Rb0ZL3lw==" + "version": "2.1.15", + "resolved": "https://registry.npmjs.org/vuetify/-/vuetify-2.1.15.tgz", + "integrity": "sha512-M35NJvlzkbCpFfsK08xraNvCpiNCIbYUXI/hkzjWHQV1MFIZnjrDTVtYoiudCyJ52zlrhWezAr4pzFOCLAr6RA==" }, "vuetify-loader": { "version": "1.4.3", diff --git a/package.json b/package.json index fc83e5d..1eed13b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-tools", - "version": "0.4.5", + "version": "0.4.6", "private": true, "author": "Maiis Trancegenik ", "scripts": { @@ -23,19 +23,19 @@ "lodash": "^4.17.15", "open": "^6.4.0", "reconnecting-websocket": "^4.2.0", - "vue": "^2.6.10", + "vue": "^2.6.11", "vue-notification": "^1.3.20", - "vuetify": "^2.1.13" + "vuetify": "^2.1.15" }, "devDependencies": { "@vue/cli-service": "^3.12.1", - "electron": "^6.1.5", + "electron": "^6.1.7", "node-sass": "^4.13.0", "sass": "^1.23.7", "sass-loader": "^7.3.1", - "vue-cli-plugin-electron-builder": "^1.4.3", + "vue-cli-plugin-electron-builder": "^1.4.4", "vue-cli-plugin-vuetify": "^0.6.3", - "vue-template-compiler": "^2.6.10", + "vue-template-compiler": "^2.6.11", "vuetify-loader": "^1.4.3" }, "postcss": { diff --git a/src/App.vue b/src/App.vue index 28533ac..7ab9b93 100644 --- a/src/App.vue +++ b/src/App.vue @@ -44,5 +44,12 @@ ::-webkit-scrollbar-thumb { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.8); } - + + @media (min-width: 960px) { + .container { + max-width: 100%; + } + } + + diff --git a/src/components/Home/Home.html b/src/components/Home/Home.html index 13d6417..e016318 100644 --- a/src/components/Home/Home.html +++ b/src/components/Home/Home.html @@ -33,19 +33,20 @@ - + Ladder - + Limit - + Market - diff --git a/src/plugins/bybitApi.js b/src/plugins/bybitApi.js index 33080db..bf1f335 100644 --- a/src/plugins/bybitApi.js +++ b/src/plugins/bybitApi.js @@ -2,7 +2,6 @@ import axios from 'axios'; import CryptoJS from 'crypto-js'; import ReconnectingWebSocket from 'reconnecting-websocket'; - export default { install(Vue, defaultOptions = {}) { Vue.prototype.$bybitApi = new Vue({ @@ -242,10 +241,11 @@ export default { symbol: this.currentSymbol, take_profit: takeProfit, stop_loss: stopLoss, - trailing_stop: trailingStop - } ; + trailing_stop: trailingStop, + }; try { - let res = await axios.post(this.url + 'open-api/position/trading-stop', + let res = await axios.post( + this.url + 'open-api/position/trading-stop', this.signData(data)); console.log(res); if (res.data.ret_msg === 'ok') { @@ -259,7 +259,7 @@ export default { type: 'error', }); } - + } catch (e) { console.error(e); this.$notify({ @@ -270,10 +270,10 @@ export default { }, async placeOrder(data) { try { - let res = await axios.post(this.url + 'open-api/order/create', + let res = await axios.post(this.url + 'v2/private/order/create', this.signData(data)); console.log(res); - if (res.data.ret_msg === 'ok') { + if (res.data.ret_msg === 'OK') { this.$notify({ text: 'Order placed', type: 'success', @@ -297,10 +297,11 @@ export default { try { let data = { order_id: id, + symbol: this.currentSymbol, }; - let res = await axios.post(this.url + 'open-api/order/cancel', + let res = await axios.post(this.url + 'v2/private/order/cancel', this.signData(data)); - if (res.data.ret_msg === 'ok') { + if (res.data.ret_msg === 'OK') { this.$notify({ text: 'Order cancelled', type: 'success', @@ -316,8 +317,25 @@ export default { } }, async cancelAllOpenOrders() { - for (let i = 0; i < this.openOrders.length; i++) { - this.cancelOrder(this.openOrders[i].order_id); + try { + let data = { + symbol: this.currentSymbol, + }; + let res = await axios.post(this.url + 'v2/private/order/cancelAll', + this.signData(data)); + if (res.data.ret_msg === 'OK') { + this.$notify({ + text: 'Orders cancelled', + type: 'success', + }); + } else { + this.$notify({ + text: res.data.ret_msg, + type: 'error', + }); + } + } catch (e) { + console.error(e); } }, async cancelAllBuyOpenOrders() {