Giter Club home page Giter Club logo

bitflyerdotnet's Introduction

BitFlyerDotNet

日本語
BitFlyerDotNet is bitFlyer Lightning API wrapper and libraries for .NET Standard 2.x.

BitFlyerDotNet is NOT official library for bitFlyer Lightning APIs.

Updates

  • 2019/09/27
    • Added ETH_JPY support._
  • 2019/09/26
    • Changed platform to .NET Standard 2.x / Core 3.0
  • 2019/06/02
    • Added GetOrderBookSource() to RealtimeSource. This functionality provides order book feed which integrates by BoardSnapshot and Board realtime APIs. See sample code.
    • Some of property definitions are changed. (ex. Status -> State)
    • BitflyerDotNet.Trading is revised. Check changes from here
    • Some of functionality was moved to Financial.Extensions.
    • Xamarin application samples are removed to shorten time of build solution.
  • 2019/05/12
    • All of prices and sizes are changed definition type from double to decimal.
    • Changed build environment Visual Studio from 2017 to 2019.
  • 2019/03/31
    • Added hot/cold start option to RealtimeExecutionSource and chaged default to hot (hot start on subscribe).
  • 2019/03/21
    • Added BTCUSD and BTCEUR support in realtime ticker API.

Environment

  • Solution and Projects are for Visual Studio 2019 and 2019 for Mac.
  • .NET Standard 2.x for libraries.
  • .NET Framework 4.71, .NET Core 3.0 and Xamarin Forms for sample applications.
  • Sample applications are tested on iOS, Android, MacOS and Windows desktop.
  • Reactive Extensions (Rx.NET)
  • JSON.NET
  • Entity Framework Core and SQLite

BitFlyerDotNet.LightningAPI

PM> Install-Package BitFlyerDotNet.LightningApi
  • bitFlyer Lightning API wrapper class library
  • Supports all of Public/Private/Realtime APIs
  • Realtime APIs are wrapped by Reactive Extensions

BitFlyerDotNet.Trading

  • BitFlyerDotNet.Trading contains BitFlyer.DotNet.LightningAPI
PM> Install-Package BitFlyerDotNet.Trading
  • Class library for trading applications
  • Quick confirm executed order
  • Error retry, safe cancel, prevent order duplication

BitFlyerDotNet.Historical

  • BitFlyerDotNet.Historical contains BitFlyer.DotNet.LightningAPI
PM> Install-Package BitFlyerDotNet.Historical
  • Class library for charting applications
  • Smart cache mechanism with Reactive Extensions and Entity Framework Core
  • Realtime updating OHLC stream with execution cache
  • Supports Cryptowatch API with cache

Sample code

Realtime API

To see sample console application from here.

using BitFlyerDotNet.LightningApi;

// Display realtime executions from WebSocket
var factory = new RealtimeSourceFactory();
factory.GetExecutionSource(BfProductCode.FXBTCJPY).Subscribe(exec =>
{
    Console.WriteLine("{0} {1} {2} {3} {4} {5}",
        exec.ExecutionId,
        exec.Side,
        exec.Price,
        exec.Size,
        exec.ExecutedTime.ToLocalTime(),
        exec.ChildOrderAcceptanceId);
});
Console.ReadLine();

Public API

using BitFlyerDotNet.LightningApi;

// Get supported currency pairs and aliases
var client = new BitFlyerClient();
var resp = client.GetMarkets();
if (resp.IsError)
{
    Console.WriteLine("Error occured:{0}", resp.ErrorMessage);
}
else
{
    foreach (var market in resp.GetResult())
    {
        Console.WriteLine("{0} {1}", market.ProductCode, market.Alias);
    }
}

Private API

using BitFlyerDotNet.LightningApi;

// Buy order
Console.Write("Key:"); var key = Console.ReadLine();
Console.Write("Secret:"); var secret = Console.ReadLine();
var client = new BitFlyerClient(key, secret);

Console.Write("Price:"); var price = decimal.Parse(Console.ReadLine());
client.SendChildOrder(BfProductCode.FXBTCJPY, BfOrderType.Limit, BfTradeSide.Buy, price, 0.001);

Sample applications

Realtime API Sample

Trading API Sample

Known issues

  • Private API getcollateralhistory always returns InternalServerError.

Let me know if you have any questions or requests. We could accept English and Japanese.

Fiats Inc.
https://www.fiats.asia/
Located in Tokyo, Japan.

bitflyerdotnet's People

Contributors

fiatsasia avatar

Watchers

 avatar

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.