업비트 자동매매 만들기
[#2-3][업비트 자동매매 C# winform] [API 요청하기]
코코코인
2021. 12. 14. 14:48
728x90
이전글:
2021.12.14 - [업비트 자동매매 만들기] - [업비트 자동매매 C# winform] [API 소스][#2-2]
※ RestSharp버전은 106.15.0 입니다.
1. APIClass.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace upbit.UpbitAPI {
public class APIClass {
private Param param;
private NoParam noparam;
public APIClass(string upbitAccessKey, string upbitSecretKey) {
param = new Param(upbitAccessKey, upbitSecretKey);
noparam = new NoParam(upbitAccessKey, upbitSecretKey);
}
public string GetAccount() {
return noparam.Get("/v1/accounts", RestSharp.Method.GET);
}
public string GetOrderChance(string market) {
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters.Add( "market", market );
return param.Get("/v1/orders/chance", parameters, RestSharp.Method.GET);
}
}
}
2. 요청하기 + Form구성
결과
다음글:
2021.12.17 - [업비트 자동매매 만들기] - [업비트 자동매매 C# winform] [Json 처리/API파일 첨부][#2-4]