BitFlyerDotNet.LightningApi 3.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package BitFlyerDotNet.LightningApi --version 3.0.1                
NuGet\Install-Package BitFlyerDotNet.LightningApi -Version 3.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BitFlyerDotNet.LightningApi" Version="3.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BitFlyerDotNet.LightningApi --version 3.0.1                
#r "nuget: BitFlyerDotNet.LightningApi, 3.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BitFlyerDotNet.LightningApi as a Cake Addin
#addin nuget:?package=BitFlyerDotNet.LightningApi&version=3.0.1

// Install BitFlyerDotNet.LightningApi as a Cake Tool
#tool nuget:?package=BitFlyerDotNet.LightningApi&version=3.0.1                

BitFlyerDotNet

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

BitFlyerDotNet is NOT official library for bitFlyer Lightning APIs.

Updates

Environment

  • Solution and Projects are for Visual Studio 2019 and 2019 for Mac.
  • .NET Standard 2.0 for libraries.
  • .NET Framework 4.71, .NET Core 3.1 for sample applications.
  • 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.
  • All of Realtime API subscribers (include private) share single WebSocket channel.

BitFlyerDotNet.Trading

  • BitFlyerDotNet.Trading contains BitFlyer.DotNet.LightningAPI
PM> Install-Package BitFlyerDotNet.Trading
  • Class library for trading applications.
  • Transaction based order management.

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 Public Channels

using BitFlyerDotNet.LightningApi;

// Display realtime executions from WebSocket
using (var factory = new RealtimeSourceFactory())
using (var source = factory.GetExecutionSource(BfProductCode.FXBTCJPY))
{
    source.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();
}

Realtime API Private Channels

using BitFlyerDotNet.LightningApi;

// Input API key and secret
Console.Write("Key:"); var key = Console.ReadLine();
Console.Write("Secret:"); var secret = Console.ReadLine();

// Display child order event from WebSocket
using (var factory = new RealtimeSourceFactory(key, secret))
using (var source = factory.GetChildOrderEventsSource(BfProductCode.FXBTCJPY))
{
    source.Subscribe(e =>
    {
        Console.WriteLine($"{e.EventDate} {e.EventType}");
    });
    Console.ReadLine();
}

Public API

using BitFlyerDotNet.LightningApi;

// Get supported currency pairs and aliases
using (var client = new BitFlyerClient())
{
    var resp = client.GetMarkets();
    if (resp.IsError)
    {
        Console.WriteLine("Error occured:{0}", resp.ErrorMessage);
    }
    else
    {
        foreach (var market in resp.GetMessage())
        {
            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();

using (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);
}

More sample code from here →

Known issues

  • 2020/07/27 GetParentOrders API is too slow or sometimes returns "Internal Server Error" if target period contains old order. Probably old parent orders are stored another slow database.

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.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on BitFlyerDotNet.LightningApi:

Package Downloads
BitFlyerDotNet.Historical

BitFlyerDotNet is a bitFlyer Lightning API wrapper and libraries.

BitFlyerDotNet.Trading

BitFlyerDotNet is a bitFlyer Lightning API wrapper and libraries.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.1.7 744 4/16/2021
4.1.0 645 2/18/2021
4.0.0 673 1/30/2021
3.1.1 829 11/9/2020
3.1.0 731 11/2/2020
3.0.2 777 10/15/2020
3.0.1 782 8/31/2020
3.0.0 908 8/15/2020
2.1.7 777 6/20/2020
2.1.6 817 6/11/2020
2.1.5 967 9/27/2019
2.1.4 874 9/26/2019
2.1.3 844 9/26/2019
2.1.1 907 7/30/2019
2.1.0 957 6/2/2019
2.0.0 930 5/12/2019
1.1.1 1,021 4/21/2019
1.1.0 964 3/20/2019
1.0.1 1,057 1/25/2019
1.0.0 682 12/6/2018