From 63097443afc8dcce67ffda83ac18c08c7c827164 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 05:15:43 +0000 Subject: [PATCH 1/5] build(deps-dev): bump vite from 4.3.8 to 4.3.9 Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.3.8 to 4.3.9. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v4.3.9/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fbe380da..38580900 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "typescript": "~5.0.4", "unplugin-icons": "^0.16.1", "unplugin-vue-components": "^0.25.0", - "vite": "^4.3.8", + "vite": "^4.3.9", "vitest": "^0.31.2", "vue-tsc": "^1.6.5" } diff --git a/yarn.lock b/yarn.lock index ad5cd1a0..ed90b4e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3509,10 +3509,10 @@ vite-node@0.31.2: picocolors "^1.0.0" vite "^3.0.0 || ^4.0.0" -"vite@^3.0.0 || ^4.0.0", vite@^4.3.8: - version "4.3.8" - resolved "https://registry.yarnpkg.com/vite/-/vite-4.3.8.tgz#70cd6a294ab52d7fb8f37f5bc63d117dd19e9918" - integrity sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ== +"vite@^3.0.0 || ^4.0.0", vite@^4.3.9: + version "4.3.9" + resolved "https://registry.yarnpkg.com/vite/-/vite-4.3.9.tgz#db896200c0b1aa13b37cdc35c9e99ee2fdd5f96d" + integrity sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg== dependencies: esbuild "^0.17.5" postcss "^8.4.23" From c19c1695dc925638fa8e0ac4cba38d151e461bf9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 1 Jun 2023 06:23:28 +0200 Subject: [PATCH 2/5] Fix disappearing theme select button --- src/components/ThemeSelect.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ThemeSelect.vue b/src/components/ThemeSelect.vue index 962c7099..d8b1601c 100644 --- a/src/components/ThemeSelect.vue +++ b/src/components/ThemeSelect.vue @@ -1,5 +1,5 @@ @@ -11,7 +11,7 @@ import { onMounted, ref } from 'vue'; const activeTheme = ref(''); const settingsStore = useSettingsStore(); -const setTheme = (themeName) => { +const setTheme = (themeName: string) => { // If theme is already active, do nothing. if (activeTheme.value === themeName) { return; From b716a165c87e731925e7934fe99e9b0cd381feda Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 2 Jun 2023 17:05:10 +0200 Subject: [PATCH 3/5] Use bootstraps bultin functionality to switch theme --- index.html | 34 +++++++++++++----------- src/components/ThemeSelect.vue | 12 ++++----- src/styles/_bootstrap_variables_ovw.scss | 3 +++ src/styles/_styles_ovw.scss | 17 +++++++----- 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/index.html b/index.html index 2b6ad1e9..cf82fac6 100644 --- a/index.html +++ b/index.html @@ -1,18 +1,22 @@ - - - - - - - FreqUI + + + + + + + + FreqUI + + + + + +
+ + - - - -
- - diff --git a/src/components/ThemeSelect.vue b/src/components/ThemeSelect.vue index d8b1601c..7ab2ac68 100644 --- a/src/components/ThemeSelect.vue +++ b/src/components/ThemeSelect.vue @@ -6,8 +6,11 @@ diff --git a/src/stores/plotConfig.ts b/src/stores/plotConfig.ts index 2e906098..1f8d2a5d 100644 --- a/src/stores/plotConfig.ts +++ b/src/stores/plotConfig.ts @@ -72,6 +72,11 @@ export const usePlotConfigStore = defineStore('plotConfig', { this.editablePlotConfig = deepClone(this.customPlotConfigs[this.plotConfigName]); } }, + duplicatePlotConfig(oldName: string, newName: string) { + console.log(oldName, newName); + this.customPlotConfigs[newName] = deepClone(this.customPlotConfigs[oldName]); + this.plotConfigChanged(newName); + }, }, persist: { key: FT_PLOT_CONFIG_KEY, From f986c7c907d721656bcea4a420d009ac7af3aef5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 3 Jun 2023 12:32:05 +0200 Subject: [PATCH 5/5] Add exchanges endpoint --- src/stores/ftbot.ts | 15 ++++++++++++++- src/types/exchange.ts | 18 ++++++++++++++++++ src/types/index.ts | 1 + src/types/types.ts | 6 ++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/types/exchange.ts diff --git a/src/stores/ftbot.ts b/src/stores/ftbot.ts index 1eac2a09..04728f34 100644 --- a/src/stores/ftbot.ts +++ b/src/stores/ftbot.ts @@ -35,6 +35,9 @@ import { TradeResponse, ClosedTrade, BotDescriptor, + Exchange, + ExchangeListResult, + FreqAIModelListResult, } from '@/types'; import axios, { AxiosResponse } from 'axios'; import { defineStore } from 'pinia'; @@ -42,7 +45,6 @@ import { showAlert } from './alerts'; import { useWebSocket } from '@vueuse/core'; import { FTWsMessage, FtWsMessageTypes } from '@/types/wsMessageTypes'; import { showNotification } from '@/shared/notifications'; -import { FreqAIModelListResult } from '../types/types'; export function createBotSubStore(botId: string, botName: string) { const userService = useUserService(botId); @@ -84,6 +86,7 @@ export function createBotSubStore(botId: string, botName: string) { strategyPlotConfig: undefined as PlotConfig | undefined, strategyList: [] as string[], freqaiModelList: [] as string[], + exchangeList: [] as Exchange[], strategy: {} as StrategyResult, pairlist: [] as string[], currentLocks: undefined as LockResponse | undefined, @@ -441,6 +444,16 @@ export function createBotSubStore(botId: string, botName: string) { return Promise.reject(error); } }, + async getExchangeList() { + try { + const { data } = await api.get('/exchanges'); + this.exchangeList = data.exchanges; + return Promise.resolve(data.exchanges); + } catch (error) { + console.error(error); + return Promise.reject(error); + } + }, async getAvailablePairs(payload: AvailablePairPayload) { try { const { data } = await api.get('/available_pairs', { diff --git a/src/types/exchange.ts b/src/types/exchange.ts new file mode 100644 index 00000000..adcec421 --- /dev/null +++ b/src/types/exchange.ts @@ -0,0 +1,18 @@ +import { MarginMode, TradingMode } from './types'; + +export interface TradeMode { + trading_mode: TradingMode; + margin_mode: MarginMode; +} + +export interface Exchange { + name: string; + valid: boolean; + supported: boolean; + comment: string; + trade_modes: TradeMode[]; +} + +export interface ExchangeListResult { + exchanges: Exchange[]; +} diff --git a/src/types/index.ts b/src/types/index.ts index e1f8a9e0..28cc8d56 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -4,6 +4,7 @@ export * from './balance'; export * from './blacklist'; export * from './botComparison'; export * from './chart'; +export * from './exchange'; export * from './daily'; export * from './locks'; export * from './plot'; diff --git a/src/types/types.ts b/src/types/types.ts index 2ac0e7cf..64c13465 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -80,6 +80,12 @@ export enum TradingMode { FUTURES = 'futures', } +export enum MarginMode { + NONE = 'none', + ISOLATED = 'isolated', + // CROSS = 'cross', +} + export interface UnfilledTimeout { /** @deprecated replaced by entry in 2.x */ buy?: number;