QuadrigaWrapper 1.0.2
dotnet add package QuadrigaWrapper --version 1.0.2
NuGet\Install-Package QuadrigaWrapper -Version 1.0.2
<PackageReference Include="QuadrigaWrapper" Version="1.0.2" />
paket add QuadrigaWrapper --version 1.0.2
#r "nuget: QuadrigaWrapper, 1.0.2"
// Install QuadrigaWrapper as a Cake Addin
#addin nuget:?package=QuadrigaWrapper&version=1.0.2
// Install QuadrigaWrapper as a Cake Tool
#tool nuget:?package=QuadrigaWrapper&version=1.0.2
QuadrigaWrapper
A simple .NET wrapper for QuadrigaCX's API (v2).
DISCLAIMER: I am not responsible for any action, such as a loss of coins, that could take place while using this wrapper. If you use this wrapper, you agree that any losses are your own liability and I cannot be held responsible. With that said, this is a simple wrapper and I have used it without issue.
Please refer to Quadriga's API documentation for a list of all possible endpoints. This wrapper contains methods for all endpoints (with the exception of the slur of deposit and withdrawl endpoints. All deposit and withdrawal endpoints have been consolidated into single methods that allow you to specify the currency).
Getting Started
You will need to obtain both an API key and secret from Quadriga. You can do this by logging into your account, and clicking on your name in the right corner. This will open a drop-down menu from which you'll need to click API Setup. Follow the instructions on there to generate an API key if you do not already have one.
Initializing a Quadriga object
Initalize a new Quadriga object with your API key, secret and client ID information that you obtained from Quadriga's website
Quadriga wrapper = new Quadriga("YOUR API KEY", "YOUR API SECRET", "YOUR CLIENT ID");
Examples
Obtaining your account balances
The AccountBalance object contains the balances, available amount and reserved amount for all currencies on Quadriga.
AccountBalance acct = wrapper.GetAccountBalance();
Console.WriteLine("CAD: ${0}\nBTC: {1}\nLTC: {2}", acct.CAD_Balance, acct.BTC_Balance, acct.LTC_Balance);
Obtaining open orders
The Order object contains the Id, Book, DateTime, Type (0 = Buy, 1 = Sell), Price, Amount and Status (0 = Active, 1 = Partially Filled) of the specified order.
List<Order> openOrders = wrapper.GetOpenOrders("ltc_btc");
foreach (var order in openOrders)
{
Console.WriteLine("Order Id: {0}", order.Id);
Console.WriteLine("DateTime: {0}", order.DateTime);
Console.WriteLine("Price: {0}", order.Price);
Console.WriteLine("Amount: {0}", order.Amount);
Console.WriteLine("Type: {0}", order.Type == 0 ? "Buy" : "Sell");
Console.WriteLine("Status: {0}", order.Status == 0 ? "Active" : "Partially Filled");
}
Lookup an order
Order order = wrapper.LookupOrder("64 CHAR ORDER ID");
Console.WriteLine("Order Status: {0}", order.Status);
Placing a buy limit order
If successfully placed, an Order object is returned where you can obtain the Id. Sell orders work the same, simply switch BuyLimitOrder to SellLimitOrder
wrapper.BuyLimitOrder(10, 100, "ltc_cad"); // (ex. 10 LTC at $100 CAD)
Placing a buy market order
If successfully placed, an Order object is returned where you can obtain the Id. Sell orders work the same, simply switch BuyMarketOrder to SellMarketOrder
wrapper.BuyMarketOrder(10, "ltc_cad"); // (ex. 10 LTC at market price)
Cancelling an order
bool status = wrapper.CancelOrder("64 CHAR ORDER ID");
if (status)
Console.WriteLine("Order successfully cancelled.");
else
Console.WriteLine("Order was not cancelled.");
Getting funding addresses
Supply the fullname of the currency
Console.WriteLine(wrapper.Deposit("bitcoin")); // output example: 3JBKhuFEvoJXBprwFQnPFVai918xsLp8pA
Placing a withdrawal request
Supply the fullname of the currency along with the amount and receiving address
string status = wrappper.Withdrawl("bitcoin", 2.431234, "3JBKhuFEvoJXBprwFQnPFVai918xsLp8pA");
if (status == "OK")
Console.WriteLine("Withdrawl request successfully submitted.");
else
Console.WriteLine("Error submitting withdrawl request.");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 is compatible. net452 is compatible. net46 is compatible. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
-
- Newtonsoft.Json (>= 11.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added support for multiple .NET framework versions.