Exemplo n.º 1
0
        public static async Task <ConstantsResponse> RefreshAsync()
        {
            var response = await KorbitCall.GetAsync <ConstantsResponse>("v1/constants");

            Value = response;

            return(response);
        }
Exemplo n.º 2
0
        public static async Task <DetailedTickerResponse> QueryDetailedAsync(CurrencyType type)
        {
            var param = new Dictionary <string, object>()
            {
                { "currency_pair", type.ToCurrencyPair() }
            };

            var response = await KorbitCall.GetAsync <DetailedTickerResponse>("/v1/ticker", param);

            return(response);
        }
Exemplo n.º 3
0
        public static async Task <WalletResponse> QueryWalletAsync(CurrencyType type)
        {
            var param = new Dictionary <string, object>()
            {
                { "currency_pair", type.ToCurrencyPair() }
            };

            var response = KorbitCall.GetAsync <WalletResponse>("v1/user/wallet", param);

            return(await response);
        }
Exemplo n.º 4
0
        public static async Task <OrderHistoryResponse> QueryOrderHistoryAsync(CurrencyType type, TimePeriod period)
        {
            var param = new Dictionary <string, object>()
            {
                { "currency_pair", type.ToCurrencyPair() },
                { "time", period.ToPeriodString() }
            };

            var response = await KorbitCall.GetAsync <OrderHistoryResponse>("v1/transactions", param);

            return(response);
        }
Exemplo n.º 5
0
        public static async Task <OrderbookResponse> QueryOrderbookAsync(CurrencyType type)
        {
            var param = new Dictionary <string, object>()
            {
                { "currency_pair", type.ToCurrencyPair() },
                { "category", "all" }
            };

            var response = await KorbitCall.GetAsync <OrderbookResponse>("v1/orderbook", param);

            return(response);
        }
Exemplo n.º 6
0
        public static async Task <string> PlaceAsk(CurrencyType type, int price, double amount)
        {
            var param = new Dictionary <string, object>()
            {
                { "currency_type", type.ToCurrencyPair() },
                { "type", "limit" },
                { "price", price },
                { "coin_amount", amount }
            };

            var response = await KorbitCall.PostAsync <ExchangeResponse>("v1/user/orders/sell", param);

            return(response.status);
        }
Exemplo n.º 7
0
        public static async Task <RequestAccessTokenResponse> RefreshAccessTokenAsync(string clientId, string clientSecret, string refreshToken)
        {
            var param = new Dictionary <string, object>()
            {
                { "client_id", clientId },
                { "client_secret", clientSecret },
                { "refresh_token", refreshToken },
                { "grant_type", "refresh_token" }
            };

            var response = KorbitCall.PostAsync <RequestAccessTokenResponse>("v1/oauth2/access_token", param);

            return(await response);
        }
Exemplo n.º 8
0
        public static async Task <RequestAccessTokenResponse> RequestAccessTokenAsync(
            string clientId, string clientSecret, string username, string password)
        {
            var param = new Dictionary <string, object>()
            {
                { "client_id", clientId },
                { "client_secret", clientSecret },
                { "username", username },
                { "password", password },
                { "grant_type", "password" }
            };

            var response = KorbitCall.PostAsync <RequestAccessTokenResponse>("v1/oauth2/access_token", param);

            return(await response);
        }