Git Product home page Git Product logo

bittrexsharp's Introduction

BittrexSharp

Introduction

BittrexSharp is a thin wrapper around the Bittrex api which wraps each endpoint as a C# function and has a dedicated class for all returned objects. So BittrexSharp allows type-safe developing with the Bittrex api.
It exposes the same fields, so its documentation of input and output is applicable for BittrexSharp too.
BittrexSharp also handles authentication.

Installing

BittrexSharp is listed as Nuget package, so you can either use the package manager UI, or install it with the Package Manager CLI

Install-Package BittrexSharp -Version 0.1.0

or with .Net CLI

dotnet add package BittrexSharp --version 0.1.0

Using BittrexSharp

The main class is Bittrex. It is the main wrapper for the api. The only things needed for its instantiation is an api key and its secret.

var apiKey = "...";
var apiSecret = "...";
var bittrex = new Bittrex(apiKey, apiSecret);

Specialized Implementations

At the moment there is only one, BittrexOrderSimulation.
It simulates every api call related to orders. So buy, sell and list orders calls are not sent to the Bittrex servers, and instead are locally registered. All other api calls work normally.
The instance then continuously queries the Bittrex servers for the current rate, and if it is below the specified limit of an order, it treats the order as executed.
This makes it easier to test trading algorithms.

Instantiating it works exactly the same as with the standard Bittrex wrapper.

var apiKey = "...";
var apiSecret = "...";
var bittrex = new BittrexOrderSimulation(apiKey, apiSecret);

bittrexsharp's People

Contributors

domysee avatar jfversluis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bittrexsharp's Issues

Exceptions when Bittrex API return false?

I realize this is a change to the API but it would be nice to have all return types inherit from BittrexResponse so we didn't have to try catch everything and do error handling in catch blocks, ie, we could just take Success? Anyway, love the API, works great.

Implement a default Constructor

To use the public api, api key and secret are not needed.
Therefore, it should not be necessary to provide it.
The implementation should check if a key and secret were provided, and if not, throw an exception if an api call would be made that needs them.

Account API's return "INVALID_SIGNATURE"

I think there is an issue with the apisign when you use the account API's. For instance, I have no problems with your code but

var xx = await this.bittrex.GetBalances();

blows with "INVALID_SIGNATURE" even though the nonce and hash are there. I read somewhere that the hash must be generated against the entire URL with all the parameters on it. Could this be the issue?

Other than that the API work great thus far, but I really need the account API's to work

Add Unit Tests

  • If the correct exception is thrown if the returned json cannot be converted
  • If the return value is an unsuccessful ResponseWrapper with the correct message
  • If the methods that need authorization work correctly if valid authorization is given
  • If a useful exception is thrown if the response json is malformed (cannot be converted to BittrexResponse)

Add continuous Checking for open Order to BittrexOrderSimulation

BittrexOrderSimulation is a Bittrex api implementation that simulates all aspects of orders, so that it is possible to test trading algorithms without actually executing them.
The last bit of simulation, continuously checking if the open orders are executed in another thread, is what this issue refers to.

GetMarketSummaries returns null

I think the title says it all...
Says that it has timed out, but seems to do this really quickly. I imagine this would take a little while to return.

I have gotten GetMarkethistory to work, and am Implementing similarly.

Thanks

Unable to open in VS 2015

Hi,

unable to open in VS 2015, Shows

error : The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.

Add API v2.0 calls

While the v2.0 API isn't offically supported yet, there is some good stuff in there and it has already been reversed engineered here.

Is this something you would want to add already? I can do it for you if you'd like as I am looking into them right now.

System.IO.FileNotNotFoundException

Can you help?
I keep getting this error, i havent been able to connect the client yet.

System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'

1.1?

is this based on v1 or 1.1?

httpClient.SendAsync never returns anything

Hi there,

I just implemented the project files into my solution. My WPF application calls the bittrex api with a valid public and private key - with all the permissions except withdraw.

When it hits line 108 of Bittrex.cs, nothing else happens. No exception, no returns. It seems like it keeps waiting for a response for ages.

What am I missing? Anyone else with this problem?

Improve Exception Handling

At the moment exceptions are almost completely ignored.
Especially exceptions that deal with request errors would be important to handle.

Cant get it to work

When i try to use your code I get an exception.

I have a forum with a button that does the following.

Any ideas what could be the problem? I have tried this from my work and home network. I thought it could be the home ISP but work network gives the same issue.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BittrexSharp;

namespace WindowsFormsApp1
{
public partial class MainForm1 : Form
{
public MainForm1()
{
InitializeComponent();

    }

    private void button1_Click(object sender, EventArgs e)
    {
        try
        {

            var apiKey = "......"; //removed for securty
            var apiSecret = "....."; //removed for securty 
            var BittrexAPI = new Bittrex(apiKey, apiSecret);


            toolStripStatusLabel1.Text = "Balance:" + BittrexAPI.GetBalance("BTC").ToString();
        }
        catch
        {
            toolStripStatusLabel1.Text = "Diconnected to BittrexAPI";
        }
    }
}

}

capture

RATE_NOT_PROVIDED

On my machine, decimals are noted with comma's instead of dots. Comma's get URL-encoded, that means an invalid rate value is sent to bittrex and that causes the RATE_NOT_PROVIDED error message.

Simple fix here is to replace the comma's to dots in the param values. I'll create a PR shortly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.