Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
gitworkflows committed Apr 10, 2024
1 parent 09ffa6a commit 8f856bc
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 49 deletions.
6 changes: 3 additions & 3 deletions .yarn/releases/yarn-4.1.1.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cypress/e2e/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function setLoginInfo() {
localStorage.setItem(
'ftAuthLoginInfo',
'tsAuthLoginInfo',
JSON.stringify({
'tsbot.0': {
botName: 'TestBot',
Expand All @@ -11,7 +11,7 @@ export function setLoginInfo() {
},
}),
);
localStorage.setItem('ftSelectedBot', 'tsbot.0');
localStorage.setItem('tsSelectedBot', 'tsbot.0');
}

export function defaultMocks() {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('Login', () => {
cy.get('button[type=submit]')
.click()
.should(() => {
const loginInfo = JSON.parse(localStorage.getItem('ftAuthLoginInfo') || '{}');
const loginInfo = JSON.parse(localStorage.getItem('tsAuthLoginInfo') || '{}');
const bot1 = 'tsbot.0';

expect(loginInfo[bot1].botName).to.eq('TestBot');
Expand Down
24 changes: 12 additions & 12 deletions cypress/fixtures/trades.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
{
"amount": 0.014727,
"safe_price": 33949.63,
"ft_order_side": "buy",
"ts_order_side": "buy",
"order_filled_timestamp": 1626028844986,
"ft_is_entry": true,
"ts_is_entry": true,
"pair": "BTC/USDT",
"order_id": "dry_run_buy_1626028844.471467",
"status": "closed",
Expand All @@ -83,9 +83,9 @@
{
"amount": 0.014727,
"safe_price": 33949.9,
"ft_order_side": "sell",
"ts_order_side": "sell",
"order_filled_timestamp": 1626028866759,
"ft_is_entry": false,
"ts_is_entry": false,
"pair": "BTC/USDT",
"order_id": "dry_run_sell_1626028861.900895",
"status": "closed",
Expand Down Expand Up @@ -165,9 +165,9 @@
{
"amount": 0.00001,
"safe_price": 2142.29,
"ft_order_side": "buy",
"ts_order_side": "buy",
"order_filled_timestamp": 1626028846004,
"ft_is_entry": true,
"ts_is_entry": true,
"pair": "ETH/USDT",
"order_id": "dry_run_buy_1626028845.495227",
"status": "closed",
Expand All @@ -185,9 +185,9 @@
{
"amount": 0.00001,
"safe_price": 2142.03,
"ft_order_side": "sell",
"ts_order_side": "sell",
"order_filled_timestamp": 1626028863465,
"ft_is_entry": false,
"ts_is_entry": false,
"pair": "ETH/USDT",
"order_id": "dry_run_sell_1626028863.01613",
"status": "closed",
Expand Down Expand Up @@ -267,9 +267,9 @@
{
"amount": 8070.5,
"safe_price": 0.06183,
"ft_order_side": "buy",
"ts_order_side": "buy",
"order_filled_timestamp": 1626028922311,
"ft_is_entry": true,
"ts_is_entry": true,
"pair": "TRX/USDT",
"order_id": "dry_run_buy_1626028921.88793",
"status": "closed",
Expand All @@ -287,9 +287,9 @@
{
"amount": 8070.5,
"safe_price": 0.06185,
"ft_order_side": "sell",
"ts_order_side": "sell",
"order_filled_timestamp": 1626028982507,
"ft_is_entry": false,
"ts_is_entry": false,
"pair": "TRX/USDT",
"order_id": "dry_run_sell_1626028981.900712",
"status": "closed",
Expand Down
4 changes: 2 additions & 2 deletions e2e/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export async function setLoginInfo(page) {
await page.goto('/');
await page.evaluate(() => {
localStorage.setItem(
'ftAuthLoginInfo',
'tsAuthLoginInfo',
JSON.stringify({
'tsbot.0': {
botName: 'TestBot',
Expand All @@ -15,7 +15,7 @@ export async function setLoginInfo(page) {
},
}),
);
localStorage.setItem('ftSelectedBot', 'tsbot.0');
localStorage.setItem('tsSelectedBot', 'tsbot.0');
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/ThemeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const setTheme = (themeName: string) => {
// const styles = document.getElementsByTagName('style');
if (activeTheme.value) {
// Only transition if simple mode is active
document.body.classList.add('ft-theme-transition');
document.body.classList.add('ts-theme-transition');
window.setTimeout(() => {
document.body.classList.remove('ft-theme-transition');
document.body.classList.remove('ts-theme-transition');
}, 1000);
}
mode.value = themeName.toLowerCase() === 'bootstrap' ? 'light' : 'dark';
Expand Down
10 changes: 5 additions & 5 deletions src/components/tsbot/TradeDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<summary>Orders {{ trade.orders.length > 1 ? `[${trade.orders.length}]` : '' }}</summary>
<div v-for="(order, key) in trade.orders" :key="key">
<span
:title="`${order.ft_order_side} ${order.order_type} order for ${formatPriceCurrency(
:title="`${order.ts_order_side} ${order.order_type} order for ${formatPriceCurrency(
order.amount,
trade.base_currency ?? '',
)} at ${formatPriceCurrency(
Expand All @@ -113,7 +113,7 @@
>
(#{{ key + 1 }})
<i-mdi-triangle
v-if="order.ft_order_side === 'buy'"
v-if="order.ts_order_side === 'buy'"
class="me-1 color-up"
style="font-size: 0.6rem"
/>
Expand All @@ -123,15 +123,15 @@
:date="order.order_timestamp"
show-timezone
/>
<b class="ms-1" :class="order.ft_order_side === 'buy' ? 'color-up' : 'color-down'">{{
order.ft_order_side
<b class="ms-1" :class="order.ts_order_side === 'buy' ? 'color-up' : 'color-down'">{{
order.ts_order_side
}}</b>
for <b>{{ formatPrice(order.safe_price) }}</b> |
<span v-if="order.remaining && order.remaining !== 0" title="remaining"
>{{ formatPrice(order.remaining, 8) }} /
</span>
<span title="Filled">{{ formatPrice(order.filled ?? 0, 8) }}</span>
<template v-if="order.ft_order_tag"> | {{ order.ft_order_tag ?? '' }}</template>
<template v-if="order.ts_order_tag"> | {{ order.ts_order_tag ?? '' }}</template>
</span>
</div>
</details>
Expand Down
2 changes: 1 addition & 1 deletion src/components/tsbot/TradeListNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
v-for="order in trade.orders?.filter((o) => o.order_filled_timestamp !== null)"
:key="order.order_timestamp"
>
{{ order.ft_order_side }} {{ order.amount }} at {{ order.safe_price }}
{{ order.ts_order_side }} {{ order.amount }} at {{ order.safe_price }}
</li>
</ul>
</b-collapse>
Expand Down
10 changes: 5 additions & 5 deletions src/shared/charts/tradeChartData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Order, PairHistory, Trade, BTOrder } from '@/types';
import { ScatterSeriesOption } from 'echarts';

function buildTooltipCost(order: Order | BTOrder, quoteCurrency: string): string {
return `${order.ft_order_side === 'buy' ? '+' : '-'}${formatPriceCurrency(
return `${order.ts_order_side === 'buy' ? '+' : '-'}${formatPriceCurrency(
'cost' in order ? order.cost : order.amount * order.safe_price,
quoteCurrency,
)}`;
Expand All @@ -22,7 +22,7 @@ function buildToolTip(
}
${buildTooltipCost(order, quoteCurrency)}
Enter-tag: ${trade.enter_tag ?? ''}`;
tooltip += `${'ft_order_tag' in order && order.ft_order_tag && trade.enter_tag != order.ft_order_tag ? '\nOrder-Tag: ' + order.ft_order_tag : ''}`;
tooltip += `${'ts_order_tag' in order && order.ts_order_tag && trade.enter_tag != order.ts_order_tag ? '\nOrder-Tag: ' + order.ts_order_tag : ''}`;
tooltip += `${trade.exit_reason ? '\nExit-Tag: ' + trade.exit_reason : ''}`;
return tooltip;
}
Expand All @@ -35,7 +35,7 @@ function buildAdjustmentToolTip(
let tooltip = `${trade.is_short ? 'Short' : 'Long'} adjustment
${buildTooltipCost(order, quoteCurrency)}
Enter-tag: ${trade.enter_tag ?? ''}`;
tooltip += `${'ft_order_tag' in order && order.ft_order_tag ? '\nOrder-Tag: ' + order.ft_order_tag : ''}`;
tooltip += `${'ts_order_tag' in order && order.ts_order_tag ? '\nOrder-Tag: ' + order.ts_order_tag : ''}`;

return tooltip;
}
Expand Down Expand Up @@ -89,7 +89,7 @@ export function getTradeEntries(dataset: PairHistory, trades: Trade[]) {
roundTimeframe(dataset.timeframe_ms ?? 0, openTs),
order.safe_price,
OPEN_CLOSE_SYMBOL,
order.ft_order_side == 'sell' ? 180 : 0,
order.ts_order_side == 'sell' ? 180 : 0,
trade.is_short ? SHORT_COLOR : LONG_COLOR,
(trade.is_short ? 'Short' : 'Long') +
(!order.order_filled_timestamp ? ' (open)' : ''),
Expand Down Expand Up @@ -121,7 +121,7 @@ export function getTradeEntries(dataset: PairHistory, trades: Trade[]) {
roundTimeframe(dataset.timeframe_ms ?? 0, orderTs),
order.safe_price,
ADJUSTMENT_SYMBOL,
order.ft_order_side == 'sell' ? 180 : 0,
order.ts_order_side == 'sell' ? 180 : 0,
trade.is_short ? SHORT_COLOR : LONG_COLOR,
'',
buildAdjustmentToolTip(trade, order, quoteCurrency),
Expand Down
4 changes: 2 additions & 2 deletions src/shared/userService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
BotDescriptor,
} from '@/types';

const AUTH_LOGIN_INFO = 'ftAuthLoginInfo';
const AUTH_LOGIN_INFO = 'tsAuthLoginInfo';
const APIBASE = '/api/v1';

export class UserService {
Expand Down Expand Up @@ -235,7 +235,7 @@ export class UserService {
const AUTH_REFRESH_TOKEN = 'auth_ref_token'; // Legacy key - do not use
const AUTH_ACCESS_TOKEN = 'auth_access_token';
const AUTH_API_URL = 'auth_api_url';
const AUTO_REFRESH = 'ft_auto_refresh';
const AUTO_REFRESH = 'ts_auto_refresh';

const apiUrl = JSON.parse(localStorage.getItem(AUTH_API_URL) || '{}');
const refreshToken = JSON.parse(localStorage.getItem(AUTH_REFRESH_TOKEN) || '{}');
Expand Down
10 changes: 5 additions & 5 deletions src/stores/plotConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { deepClone } from '@/shared/deepClone';
import { EMPTY_PLOTCONFIG, PlotConfig, PlotConfigStorage } from '@/types';
import { defineStore } from 'pinia';

const FT_PLOT_CONFIG_KEY = 'ftPlotConfig';
const TS_PLOT_CONFIG_KEY = 'tsPlotConfig';

function migratePlotConfigs() {
// Legacy config names
const PLOT_CONFIG = 'ft_custom_plot_config';
const PLOT_CONFIG_NAME = 'ft_selected_plot_config';
const PLOT_CONFIG = 'ts_custom_plot_config';
const PLOT_CONFIG_NAME = 'ts_selected_plot_config';

const allConfigs = JSON.parse(localStorage.getItem(PLOT_CONFIG) || '{}');
if (Object.keys(allConfigs).length > 0) {
Expand All @@ -16,7 +16,7 @@ function migratePlotConfigs() {
customPlotConfigs: allConfigs,
plotConfigName: localStorage.getItem(PLOT_CONFIG_NAME) || 'default',
};
localStorage.setItem(FT_PLOT_CONFIG_KEY, JSON.stringify(res));
localStorage.setItem(TS_PLOT_CONFIG_KEY, JSON.stringify(res));
localStorage.removeItem(PLOT_CONFIG);
localStorage.removeItem(PLOT_CONFIG_NAME);
}
Expand Down Expand Up @@ -79,7 +79,7 @@ export const usePlotConfigStore = defineStore('plotConfig', {
},
},
persist: {
key: FT_PLOT_CONFIG_KEY,
key: TS_PLOT_CONFIG_KEY,
paths: ['plotConfigName', 'customPlotConfigs'],
afterRestore: (context) => {
if (Object.keys(context.store.customPlotConfigs).length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/stores/tsbotwrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '@/types';
import { defineStore } from 'pinia';
import { createBotSubStore } from './tsbot';
const AUTH_SELECTED_BOT = 'ftSelectedBot';
const AUTH_SELECTED_BOT = 'tsSelectedBot';

export type BotSubStore = ReturnType<typeof createBotSubStore>;

Expand Down
8 changes: 4 additions & 4 deletions src/styles/_styles_ovw.scss
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@
background-color: unset !important;
}

body.ft-theme-transition,
body.ft-theme-transition *,
body.ft-theme-transition *:before,
body.ft-theme-transition *:after {
body.ts-theme-transition,
body.ts-theme-transition *,
body.ts-theme-transition *:before,
body.ts-theme-transition *:after {
transition:
background 750ms ease-in-out,
border-color 750ms ease-in-out,
Expand Down
8 changes: 4 additions & 4 deletions src/types/trades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { TradingMode } from './types';
export interface BTOrder {
amount: number;
safe_price: number;
ft_order_side: string;
ts_order_side: string;
order_filled_timestamp?: number;
ft_is_entry: boolean;
ts_is_entry: boolean;
}

export interface Order extends BTOrder {
Expand All @@ -18,9 +18,9 @@ export interface Order extends BTOrder {
order_type: string;
is_open: boolean;
order_timestamp?: number;
ft_fee_base?: number;
ts_fee_base?: number;
/** Tag assigned to this order */
ft_order_tag?: string;
ts_order_tag?: string;
}

interface TradeBase {
Expand Down

0 comments on commit 8f856bc

Please sign in to comment.