BitFlyerDotNet.Trading 3.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package BitFlyerDotNet.Trading --version 3.0.1
NuGet\Install-Package BitFlyerDotNet.Trading -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.Trading" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BitFlyerDotNet.Trading --version 3.0.1
#r "nuget: BitFlyerDotNet.Trading, 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.Trading as a Cake Addin
#addin nuget:?package=BitFlyerDotNet.Trading&version=3.0.1

// Install BitFlyerDotNet.Trading as a Cake Tool
#tool nuget:?package=BitFlyerDotNet.Trading&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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.1.7 358 4/16/2021
4.1.0 312 2/18/2021
4.0.0 334 1/30/2021
3.1.1 459 11/9/2020
3.1.0 384 11/2/2020
3.0.2 406 10/15/2020
3.0.1 429 8/31/2020
3.0.0 529 8/15/2020
2.1.7 429 6/20/2020
2.1.6 442 6/11/2020
2.1.5 544 9/27/2019
2.1.4 482 9/26/2019
2.1.3 494 9/26/2019
2.1.1 525 7/30/2019
2.1.0 547 6/2/2019
2.0.0 527 5/12/2019
1.1.1 611 4/21/2019
1.1.0 545 3/20/2019
1.0.1 627 1/25/2019