DueDex 1.4.0

The official C# client SDK for DueDEX

Install-Package DueDex -Version 1.4.0
dotnet add package DueDex --version 1.4.0
<PackageReference Include="DueDex" Version="1.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DueDex --version 1.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

DueDex.NET

The official C# client SDK for DueDEX

Installation

The quickest way to install the client SDK is by using the NuGet package:

dotnet add package DueDex

Getting Started

To start using the client, add the following using directive to your code file:

using DueDex;

Then, create a client to be used throughout the application. The client object is thread-safe and you should store it to be reused:

// Creates an anonymous client to access public APIs ONLY
var anonymousClient = new DueDexClient();

// Creates an anonymous client that connects to the public TESTNET
var anonymousTestnetClient = new DueDexClient(NetworkType.Testnet);

// Creates an authenticated client
var authenticatedClient = new DueDexClient("YOUR_API_KEY", "YOUR_API_SECRET");

// Creates an authenticated client to the public TESTNET
var authenticatedClient = new DueDexClient("YOUR_API_KEY", "YOUR_API_SECRET", NetworkType.Testnet);

You can also provide an ILogger&lt;DueDexClient&gt; instance to the construtor to log messages and errors.

Using REST APIs

To interact with REST APIs, simply call the awaitable methods in the client class:

// Creates an authenticated client
var client = new DueDexClient("YOUR_API_KEY", "YOUR_API_SECRET");

// Places a new order
var order = await client.NewLimitOrderAsync("BTCUSD", OrderSide.Long, 8000, 100);

// Cancels the order
await client.CancelOrderAsync("BTCUSD", order.OrderId);

Using WebSocket APIs

To interact with WebSocket streams, the application defines handlers to listen to events:

// Creates an authenticated client
var client = new DueDexClient("YOUR_API_KEY", "YOUR_API_SECRET");

// Defines an event handler
client.MatchesUpdated += (object sender, MatchesUpdatedEventArgs eventArgs) =>
{
    foreach (var match in eventArgs.NewMatches)
        Console.WriteLine($"New match in {match.Instrument}: {match.Size} contracts at price {match.Price}");
};

// Starts the WebSocket connection
client.Subscribe(ChannelType.Matches, "BTCUSD");
client.StartWebSocket();

DueDex.NET

The official C# client SDK for DueDEX

Installation

The quickest way to install the client SDK is by using the NuGet package:

dotnet add package DueDex

Getting Started

To start using the client, add the following using directive to your code file:

using DueDex;

Then, create a client to be used throughout the application. The client object is thread-safe and you should store it to be reused:

// Creates an anonymous client to access public APIs ONLY
var anonymousClient = new DueDexClient();

// Creates an anonymous client that connects to the public TESTNET
var anonymousTestnetClient = new DueDexClient(NetworkType.Testnet);

// Creates an authenticated client
var authenticatedClient = new DueDexClient("YOUR_API_KEY", "YOUR_API_SECRET");

// Creates an authenticated client to the public TESTNET
var authenticatedClient = new DueDexClient("YOUR_API_KEY", "YOUR_API_SECRET", NetworkType.Testnet);

You can also provide an ILogger&lt;DueDexClient&gt; instance to the construtor to log messages and errors.

Using REST APIs

To interact with REST APIs, simply call the awaitable methods in the client class:

// Creates an authenticated client
var client = new DueDexClient("YOUR_API_KEY", "YOUR_API_SECRET");

// Places a new order
var order = await client.NewLimitOrderAsync("BTCUSD", OrderSide.Long, 8000, 100);

// Cancels the order
await client.CancelOrderAsync("BTCUSD", order.OrderId);

Using WebSocket APIs

To interact with WebSocket streams, the application defines handlers to listen to events:

// Creates an authenticated client
var client = new DueDexClient("YOUR_API_KEY", "YOUR_API_SECRET");

// Defines an event handler
client.MatchesUpdated += (object sender, MatchesUpdatedEventArgs eventArgs) =>
{
    foreach (var match in eventArgs.NewMatches)
        Console.WriteLine($"New match in {match.Instrument}: {match.Size} contracts at price {match.Price}");
};

// Starts the WebSocket connection
client.Subscribe(ChannelType.Matches, "BTCUSD");
client.StartWebSocket();

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.4.0 56 8/10/2019
1.3.0 51 7/29/2019
1.2.1 54 7/25/2019
1.2.0 51 7/20/2019
1.1.0 61 7/9/2019
1.0.0 65 6/13/2019