Skip to content

Commit

Permalink
FIX: type file 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperRyou committed Dec 8, 2024
1 parent cee0f12 commit e92aa2f
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 32 deletions.
71 changes: 71 additions & 0 deletions src/_type/account.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
declare namespace Account {
interface PostSubscribeBody {
productId: number;
promotionCode?: string;
}
interface SubscribeT {
subscribeId: number;
productName: string;
expiryDate: string;
}
interface HoldingCoinRatioT {
name: string;
price: number;
ratio: number;
}
interface TradeStyleT {
tag: string[];
accountBalance: number;
winRate: number;
totalProfitLossRate: number;
}
interface AvailableBalanceT {
exchangeName: string;
availableBalance: number;
}
interface BotResultChartResponseT {
botId: number;
coinName: string;
presetName: string;
totalProfit: number;
totalProfitRate: number;
chartData: {
date: string;
price: string;
rate: string;
}[];
}
interface BotResultChartT {
botId: number;
coinName: string;
presetName: string;
totalProfit: number;
totalProfitRate: number;
chartData: {
date: string[];
price: number[];
rate: number[];
};
}
interface BotResultDataT {
totalTradePrice: {
value: number;
difference: number;
};
totalTradeCount: {
value: number;
difference: number;
};
maxProfitRate: {
rate: number;
presetName: string;
coinName: string;
};
maxWinRate: {
rate: number;
presetName: string;
coinName: string;
};
totalTradeBalance: number;
}
}
49 changes: 49 additions & 0 deletions src/_type/bot.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
declare namespace Bot {
interface PostBotStartBody {
botName: string;
presetId: number;
coinId: number;
startBalance: number;
leverage: number | null;
}
interface InfoT {
id: number;
isRunning: boolean;
presetName: string;
startBalance: number;
runningTime: number;
coinType: string;
}
interface TransactionResponseT {
id: number;
exchange: string;
date: string;
coinName: string;
position: string;
totalPrice: number;
volume: number;
profitLoss: number;
profitLossRate: number;
startBalance: number;
presetName: string;
}
interface TransactionT {
id: number;
market: string;
tradeTime: string;
coinName: string;
status: string;
quantity: {
totalPrice: number;
volume: number;
};
price: {
startBalance: number;
presetName: string;
};
profit: {
profitLoss: number;
profitLossRate: number;
};
}
}
29 changes: 29 additions & 0 deletions src/_type/common.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
declare namespace Common {
interface RankingResponseT {
id: number;
rank: number;
userName: string;
exchangeName: string;
coinName: string;
profitLossRate: number;
duration: number;
presetData: string;
}
interface RankingT {
id: number;
rank: number;
user: {
icon: string;
nickname: string;
};
market: string;
item: string;
accumulatedProfit: number;
period: number;
presetData: string;
}
interface CoinT {
id: number;
coinName: string;
}
}
15 changes: 15 additions & 0 deletions src/_type/exchange.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
type ExchangeType = "okx" | "upbit" | "binance" | "lbank";

type ExchangeParams = {
exchange: ExchangeType;
};

declare namespace ExchangeConnection {
interface PostOkxOauthTokenBody {
code: string;
}

interface PostSmartAccessResultBody {
uid: string;
}
}
17 changes: 17 additions & 0 deletions src/_type/preset.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
declare namespace Preset {
interface PostPresetBody {
presetName: string;
indicatorName: string;
presetData: string;
position: string;
profitCutRate: number;
lossCutRate: number;
}
interface PresetT extends PostPresetBody {
id: number;
}
interface IndicatorT {
id: number;
indicatorName: string;
}
}
10 changes: 10 additions & 0 deletions src/_type/query.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
interface ResponseT<Data> {
data: Data;
status: number;
msg: string;
}

interface RequestT<Body, Params = undefined> {
body: Body;
params: Params;
}
28 changes: 0 additions & 28 deletions src/hooks/query/_query.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ type DashboardIdType =

type SocialType = "linkedin" | "facebook" | "naver" | "kakao";

// exchange
type ExchangeType = "okx" | "upbit" | "binance" | "lbank";

// agreement
type AgreementType = "over14" | "service" | "privacy" | "marketing";

Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"incremental": true,
"paths": {
"@/*": ["./src/*"]
}
},
"typeRoots": ["./node_modules/@types", "./src/types"]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit e92aa2f

Please sign in to comment.