단순 이관
This commit is contained in:
46
Bitget_Server/Domain/BitgetEndpoints.cs
Normal file
46
Bitget_Server/Domain/BitgetEndpoints.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
namespace Bitget_Server.Domain;
|
||||
|
||||
/// <summary>
|
||||
/// Bitget REST API 엔드포인트 URL 상수.
|
||||
/// </summary>
|
||||
public static class BitgetEndpoints
|
||||
{
|
||||
public const string BaseUrl = "https://api.bitget.com";
|
||||
|
||||
public const string MarketInfo_Coin = "https://api.bitget.com/api/v2/spot/public/coins";
|
||||
public const string MarketInfo_Future = "https://api.bitget.com/api/v2/mix/market/tickers?productType=USDT-FUTURES";
|
||||
|
||||
public const string MarketCandle_Coin = "https://api.bitget.com/api/v2/spot/market/candles?symbol={0}&granularity={1}in&startTime={2}&endTime={3}&limit={4}";
|
||||
public const string MarketCandle_Future = "https://api.bitget.com/api/v2/mix/market/candles?symbol={0}&granularity={1}&limit={2}&productType={3}";
|
||||
|
||||
public const string AccountList_Future = "https://api.bitget.com/api/v2/mix/account/accounts?productType=USDT-FUTURES";
|
||||
public const string BuySellOrder_Future = "https://api.bitget.com/api/v2/mix/order/place-order";
|
||||
public const string CancelOrder_Future = "https://api.bitget.com/api/v2/mix/order/cancel-order";
|
||||
public const string PendingOrders_Future = "https://api.bitget.com/api/v2/mix/order/orders-pending?productType=usdt-futures";
|
||||
public const string ChangeLeverage_Future = "https://api.bitget.com/api/v2/mix/account/set-leverage";
|
||||
public const string ChangeMarginMode_Future = "https://api.bitget.com/api/v2/mix/account/set-margin-mode";
|
||||
public const string ChangePositionMode_Future = "https://api.bitget.com/api/v2/mix/account/set-position-mode";
|
||||
public const string OrderDetail_Future = "https://api.bitget.com/api/v2/mix/order/detail";
|
||||
public const string GetTimestamp = "https://api.bitget.com/api/v2/public/time";
|
||||
|
||||
public const string WebSocketPublic = "wss://ws.bitget.com/v2/ws/public";
|
||||
}
|
||||
|
||||
#region 업비트 (미사용 - 레거시 상수)
|
||||
public static class UpbitEndpoints
|
||||
{
|
||||
public const string BaseUrl = "https://api.upbit.com/";
|
||||
public const string MarketInfo = "https://api.upbit.com/v1/market/all";
|
||||
public const string MCandleStick = "https://api.upbit.com/v1/candles/minutes/";
|
||||
public const string DCandleStick = "https://api.upbit.com/v1/candles/days";
|
||||
public const string WCandleStick = "https://api.upbit.com/v1/candles/weeks";
|
||||
public const string MTCandleStick = "https://api.upbit.com/v1/candles/months";
|
||||
public const string Accounts = "https://api.upbit.com/v1/accounts";
|
||||
public const string Ticker = "https://api.upbit.com/v1/ticker";
|
||||
public const string Ticks = "https://api.upbit.com/v1/trades/ticks";
|
||||
public const string Orders = "https://api.upbit.com/v1/orders";
|
||||
public const string Order = "https://api.upbit.com/v1/order";
|
||||
public const string Orderbook = "https://api.upbit.com/v1/orderbook";
|
||||
public const string OrderChance = "https://api.upbit.com/v1/orders/chance";
|
||||
}
|
||||
#endregion
|
||||
175
Bitget_Server/Domain/Enums/Enums.cs
Normal file
175
Bitget_Server/Domain/Enums/Enums.cs
Normal file
@@ -0,0 +1,175 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Bitget_Server.Domain.Enums;
|
||||
|
||||
public enum WebConnectionType
|
||||
{
|
||||
POST = 0,
|
||||
GET = 1
|
||||
}
|
||||
|
||||
public enum ExchangePlace
|
||||
{
|
||||
Upbit = 0,
|
||||
Bithumb = 1,
|
||||
Bitget = 2
|
||||
}
|
||||
|
||||
// 코인 Payment 타입
|
||||
public enum PaymentType
|
||||
{
|
||||
KRW = 0,
|
||||
BTC = 1,
|
||||
USDT = 2
|
||||
}
|
||||
|
||||
// 최신, 가장오래된, None
|
||||
public enum CandleType
|
||||
{
|
||||
None = 0,
|
||||
Old = 1,
|
||||
New = 2
|
||||
}
|
||||
|
||||
// Bitget FUTURE 코인 타입
|
||||
public enum BitgetProductType
|
||||
{
|
||||
COIN = 0,
|
||||
FUTURE = 1,
|
||||
MARGIN_보류 = 2
|
||||
}
|
||||
|
||||
// 거래소 Web 요청 타입
|
||||
public enum ExchangeWebReqType
|
||||
{
|
||||
[Description("/Public/CandleStick")]
|
||||
BithumbCandleStick = 0,
|
||||
[Description("/public/ticker")]
|
||||
BithumbCandleTicker = 1,
|
||||
[Description("/public/Orderbook")]
|
||||
BithumbMarket = 2,
|
||||
|
||||
[Description("UpbitCandle")]
|
||||
UpbitCandleStick = 10,
|
||||
[Description("UpbitMarket")]
|
||||
UpbitMarket = 11,
|
||||
|
||||
[Description("BitgetMarketInfo_SPOT")]
|
||||
BitgetMarket_Spot = 20,
|
||||
[Description("BitgetMarketInfo_FUTURE")]
|
||||
BitgetMarket_Future = 21,
|
||||
[Description("BitgetMCandle_COIN")]
|
||||
BitgetCandleStick_Coin = 22,
|
||||
[Description("BitgetMCandle_FUTURE")]
|
||||
BitgetCandleStick_Future = 23,
|
||||
[Description("BitgetAccountList_FUTURE")]
|
||||
BitgetAccountList_Future = 30,
|
||||
[Description("BitgetOrder_FUTURE")]
|
||||
BitgetOrder_Future = 31,
|
||||
[Description("BitgetOrderCancel_FUTURE")]
|
||||
BitgetCancelOrder_Future = 32,
|
||||
[Description("BitgetPendingOrder_FUTURE")]
|
||||
BitgetPendingOrder_Future = 33,
|
||||
[Description("BitgetChangeLeverage_FUTURE")]
|
||||
BitgetChangeLeverage_Future = 34,
|
||||
[Description("BitgetChangeMarginMode_FUTURE")]
|
||||
BitgetChangeMarginMode_Future = 35,
|
||||
[Description("BitgetChangePositionMode_FUTURE")]
|
||||
BitgetChangePositionMode_Future = 36,
|
||||
[Description("BitgetOrderDetail_FUTURE")]
|
||||
BitgetOrderDetail_Future = 37,
|
||||
[Description("BitgetGetTimeStamp")]
|
||||
BitgetGetTimeStamp = 38
|
||||
}
|
||||
|
||||
// Bitget WebSocketType
|
||||
public enum BitgetWebSocketType
|
||||
{
|
||||
현황정보_전체종목 = 0,
|
||||
캔들정보 = 1,
|
||||
보유List = 2,
|
||||
주문하기 = 3
|
||||
}
|
||||
|
||||
public enum Side
|
||||
{
|
||||
[Description("buy")]
|
||||
buy = 0,
|
||||
[Description("sell")]
|
||||
sell = 1
|
||||
}
|
||||
|
||||
public enum FuturePositionMode
|
||||
{
|
||||
[Description("one_way_mode")]
|
||||
one_way_mode = 0,
|
||||
[Description("hedge_mode")]
|
||||
hedge_mode = 1
|
||||
}
|
||||
|
||||
public enum OrderType
|
||||
{
|
||||
[Description("limit")]
|
||||
limit = 0,
|
||||
[Description("market")]
|
||||
market = 1
|
||||
}
|
||||
|
||||
public enum FutureMarginMode
|
||||
{
|
||||
[Description("isolated")]
|
||||
isolated = 0,
|
||||
[Description("crossed")]
|
||||
crossed = 1
|
||||
}
|
||||
|
||||
public enum FutureSide
|
||||
{
|
||||
BuyShort = 0,
|
||||
BuyLong = 1,
|
||||
SellShort = 2,
|
||||
SellLong = 3
|
||||
}
|
||||
|
||||
// 시가/고가/종가/저가
|
||||
public enum CandlePriceType
|
||||
{
|
||||
시가 = 1,
|
||||
고가 = 2,
|
||||
저가 = 3,
|
||||
종가 = 4
|
||||
}
|
||||
|
||||
// 캔들 데이터 간격
|
||||
public enum MCandleTimeType
|
||||
{
|
||||
[Description("3m")]
|
||||
M3 = 3,
|
||||
[Description("5m")]
|
||||
M5 = 5,
|
||||
[Description("1m")]
|
||||
M1 = 1,
|
||||
[Description("15m")]
|
||||
M15 = 15,
|
||||
[Description("30m")]
|
||||
M30 = 30,
|
||||
[Description("1H")]
|
||||
H1 = 60,
|
||||
[Description("2H")]
|
||||
H2 = 120,
|
||||
[Description("3H")]
|
||||
H3 = 180,
|
||||
[Description("4H")]
|
||||
H4 = 240,
|
||||
[Description("6H")]
|
||||
H6 = 360,
|
||||
[Description("12H")]
|
||||
H12 = 720
|
||||
}
|
||||
|
||||
// 이동평균선 종류
|
||||
public enum MovingAverageType
|
||||
{
|
||||
캔들 = 1,
|
||||
거래량 = 2
|
||||
}
|
||||
21
Bitget_Server/Domain/Indicators/IchimokData.cs
Normal file
21
Bitget_Server/Domain/Indicators/IchimokData.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace Bitget_Server.Domain.Indicators;
|
||||
|
||||
[Serializable]
|
||||
public class IchimokData
|
||||
{
|
||||
public double 기준선 { get; set; } = 0;
|
||||
public double 전환선 { get; set; } = 0;
|
||||
public double 후행스팬 { get; set; } = 0;
|
||||
public double 선행스팬1 { get; set; } = 0;
|
||||
public double 선행스팬2 { get; set; } = 0;
|
||||
|
||||
public double 상한선 { get; set; }
|
||||
public double 하한선 { get; set; }
|
||||
|
||||
public bool IsLongUp { get; set; } = false;
|
||||
public bool IsLongDown { get; set; } = false;
|
||||
public bool IsShortUp { get; set; } = false;
|
||||
public bool IsShortDown { get; set; } = false;
|
||||
|
||||
public bool IsUsedData { get; set; } = true;
|
||||
}
|
||||
8
Bitget_Server/Domain/Indicators/ImpulseMacdData.cs
Normal file
8
Bitget_Server/Domain/Indicators/ImpulseMacdData.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Bitget_Server.Domain.Indicators;
|
||||
|
||||
public class ImpulseMacdData
|
||||
{
|
||||
public double MD;
|
||||
public double SH;
|
||||
public double SB;
|
||||
}
|
||||
14
Bitget_Server/Domain/Indicators/MovingAverageData.cs
Normal file
14
Bitget_Server/Domain/Indicators/MovingAverageData.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Bitget_Server.Domain.Indicators;
|
||||
|
||||
[Serializable]
|
||||
public class MovingAverageData
|
||||
{
|
||||
// MV Value
|
||||
public double Value { get; set; }
|
||||
// Bol Value
|
||||
public double BolangerValue_Down { get; set; }
|
||||
public double Average { get; set; }
|
||||
public double BolangerValue_Up { get; set; }
|
||||
// Bol 편차
|
||||
public double BolangerSquared { get; set; } = 2.5;
|
||||
}
|
||||
20
Bitget_Server/Domain/Models/ApiKeyInfo.cs
Normal file
20
Bitget_Server/Domain/Models/ApiKeyInfo.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Bitget_Server.Domain.Models;
|
||||
|
||||
/// <summary>
|
||||
/// 공통 API 키 정보.
|
||||
/// </summary>
|
||||
public class ApiKeyInfo
|
||||
{
|
||||
public string AccessKey { get; set; }
|
||||
public string SecretKey { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bitget 전용 API 키 정보 (Passphrase 포함).
|
||||
/// </summary>
|
||||
public class ApiKeyInfo_Bitget : ApiKeyInfo
|
||||
{
|
||||
public string PassphraseKey { get; set; } = string.Empty;
|
||||
}
|
||||
42
Bitget_Server/Domain/Models/CandleData.cs
Normal file
42
Bitget_Server/Domain/Models/CandleData.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Bitget_Server.Domain.Indicators;
|
||||
|
||||
namespace Bitget_Server.Domain.Models;
|
||||
|
||||
public class CandleData
|
||||
{
|
||||
public DateTime Argument { get; set; }
|
||||
public double Low { get; set; }
|
||||
public double High { get; set; }
|
||||
public double Open { get; set; }
|
||||
public double Close { get; set; }
|
||||
// 기본 통화 거래량 (BTC)
|
||||
public double Vol_C { get; set; }
|
||||
// 견적 통화 거래량 USD
|
||||
public double Vol_USD { get; set; }
|
||||
// USDT 거래량
|
||||
public double Vol_USDT { get; set; }
|
||||
|
||||
// 웹소켓 업데이트 기록 여부
|
||||
public bool WebSocketUpdate { get; set; } = false;
|
||||
// 웹 서비스 업데이트 기록 여부
|
||||
public bool WebServiceUpdate { get; set; } = false;
|
||||
|
||||
public CandleData() { }
|
||||
|
||||
public CandleData(DateTime argument, double low, double high, double open, double close,
|
||||
double vol_C, double vol_USD, double vol_USDT)
|
||||
{
|
||||
this.Argument = argument;
|
||||
this.Low = low;
|
||||
this.High = high;
|
||||
this.Open = open;
|
||||
this.Close = close;
|
||||
this.Vol_C = vol_C;
|
||||
this.Vol_USD = vol_USD;
|
||||
this.Vol_USDT = vol_USDT;
|
||||
}
|
||||
|
||||
public IchimokData IchimokData { get; set; }
|
||||
public Dictionary<int, MovingAverageData> movingAverageDataList { get; set; }
|
||||
public Dictionary<int, ImpulseMacdData> impulseMacdDataList { get; set; }
|
||||
}
|
||||
16
Bitget_Server/Domain/Models/MarketCandleDataList.cs
Normal file
16
Bitget_Server/Domain/Models/MarketCandleDataList.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Bitget_Server.Domain.Enums;
|
||||
|
||||
namespace Bitget_Server.Domain.Models;
|
||||
|
||||
[Serializable]
|
||||
public class MarketCandleDataList
|
||||
{
|
||||
// 코인 종목
|
||||
public MarketInfo ConGoodsData { get; set; } = new MarketInfo();
|
||||
|
||||
// 캔들 데이터 (시간 타입별)
|
||||
public Dictionary<MCandleTimeType, List<CandleData>> candleDataList { get; set; }
|
||||
= new Dictionary<MCandleTimeType, List<CandleData>>();
|
||||
|
||||
public string Uuid { get; set; }
|
||||
}
|
||||
14
Bitget_Server/Domain/Models/MarketInfo.cs
Normal file
14
Bitget_Server/Domain/Models/MarketInfo.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Bitget_Server.Domain.Models;
|
||||
|
||||
public class MarketInfo
|
||||
{
|
||||
public string ExchangePlace { get; set; }
|
||||
public string MarketName { get; set; }
|
||||
public double lastPr { get; set; }
|
||||
public double change24h { get; set; }
|
||||
public double baseVolume { get; set; }
|
||||
public double quoteVolume { get; set; }
|
||||
public double high24h { get; set; }
|
||||
public double low24h { get; set; }
|
||||
public double open24h { get; set; }
|
||||
}
|
||||
21
Bitget_Server/Domain/Models/ResponseCandleStick.cs
Normal file
21
Bitget_Server/Domain/Models/ResponseCandleStick.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Bitget_Server.Domain.Models;
|
||||
|
||||
public class ResponseCandleStick
|
||||
{
|
||||
public string action { get; set; }
|
||||
public ResponseCandleStickArg arg { get; set; }
|
||||
public List<string> data { get; set; }
|
||||
public double ts { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public DateTime reciveTime { get; set; }
|
||||
}
|
||||
|
||||
public class ResponseCandleStickArg
|
||||
{
|
||||
public string instType { get; set; }
|
||||
public string channel { get; set; }
|
||||
public string instId { get; set; }
|
||||
}
|
||||
23
Bitget_Server/Domain/Models/SignalInfoData.cs
Normal file
23
Bitget_Server/Domain/Models/SignalInfoData.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Bitget_Server.Domain.Enums;
|
||||
|
||||
namespace Bitget_Server.Domain.Models;
|
||||
|
||||
public class SignalInfoData
|
||||
{
|
||||
// 신호검색 시작 시간
|
||||
public DateTime SignalStart { get; set; }
|
||||
// 종목 이름
|
||||
public string MarketName { get; set; }
|
||||
// 종목 설명
|
||||
public string Description { get; set; }
|
||||
// 현재가
|
||||
public double Price { get; set; }
|
||||
// 설정된 시간 봉의 수익율
|
||||
public double Rate { get; set; }
|
||||
// 구름떼 상한선 가격
|
||||
public double IndicatorPrice { get; set; }
|
||||
// 설정된 지표(Indicator)와의 격차 비율
|
||||
public double IndicatorRate { get; set; }
|
||||
|
||||
public MCandleTimeType MCandleTimeType { get; set; }
|
||||
}
|
||||
19
Bitget_Server/Domain/Models/TradeData.cs
Normal file
19
Bitget_Server/Domain/Models/TradeData.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace Bitget_Server.Domain.Models;
|
||||
|
||||
public class TradeData
|
||||
{
|
||||
public string type { get; set; }
|
||||
public string code { get; set; }
|
||||
public long timestamp { get; set; }
|
||||
public string trade_date { get; set; }
|
||||
public string trade_time { get; set; }
|
||||
public long trade_timestamp { get; set; }
|
||||
public double trade_price { get; set; }
|
||||
public double trade_volume { get; set; }
|
||||
public string ask_bid { get; set; }
|
||||
public double prev_closing_price { get; set; }
|
||||
public string change { get; set; }
|
||||
public double change_price { get; set; }
|
||||
public long sequential_id { get; set; }
|
||||
public string stream_type { get; set; }
|
||||
}
|
||||
29
Bitget_Server/Domain/Models/WebSocketTickerInfo.cs
Normal file
29
Bitget_Server/Domain/Models/WebSocketTickerInfo.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace Bitget_Server.Domain.Models;
|
||||
|
||||
public class WebSocketTickerInfo
|
||||
{
|
||||
// 종목
|
||||
public string instId { get; set; }
|
||||
// 최종가격
|
||||
public double lastPr { get; set; }
|
||||
// 24시간 시가
|
||||
public double open24h { get; set; }
|
||||
// 24시간 고가
|
||||
public double high24h { get; set; }
|
||||
// 24시간 저가
|
||||
public double low24h { get; set; }
|
||||
// 수익률
|
||||
public double change24h { get; set; }
|
||||
public double bidPr { get; set; }
|
||||
public double askPr { get; set; }
|
||||
public double bidSz { get; set; }
|
||||
public double askSz { get; set; }
|
||||
// 코인 거래량
|
||||
public double baseVolume { get; set; }
|
||||
// 견적통화 거래량
|
||||
public double quoteVolume { get; set; }
|
||||
public double openUtc { get; set; }
|
||||
public double changeUtc24h { get; set; }
|
||||
public long ts { get; set; }
|
||||
public DateTime reciveTime { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user