FinClient 0.1.0
See the version list below for details.
dotnet add package FinClient --version 0.1.0
NuGet\Install-Package FinClient -Version 0.1.0
<PackageReference Include="FinClient" Version="0.1.0" />
<PackageVersion Include="FinClient" Version="0.1.0" />
<PackageReference Include="FinClient" />
paket add FinClient --version 0.1.0
#r "nuget: FinClient, 0.1.0"
#:package FinClient@0.1.0
#addin nuget:?package=FinClient&version=0.1.0
#tool nuget:?package=FinClient&version=0.1.0
FinClient for .NET
The official .NET client for the FinCopy public API: hosted MetaTrader accounts, their settings, trading, the change feed and webhooks. Runs on .NET 8 or later and on .NET Standard 2.0 (including .NET Framework 4.6.2+).
dotnet add package FinClient
Quick start
using Fin;
using Fin.Copy;
using var fin = new FinClient(new FinClientOptions { ApiKey = Environment.GetEnvironmentVariable("FINCOPY_API_KEY")! });
var accounts = await fin.Copy.Accounts.ListAsync();
Create one FinClient per API key and reuse it; it is safe to share between threads. With dependency injection, register
it once:
services.AddFinClient(options => options.ApiKey = configuration["FinCopy:ApiKey"]!);
Trades complete asynchronously
fin.Copy.Orders.MakeAsync(...) returns once the order is queued for your MetaTrader terminal, not when it is filled. The
terminal picks it up on its next sync (seconds). Follow the change feed, or set a webhook, to see each order filled (with its
ticket) or refused (with the reason).
The change feed
Read it a page at a time and save the cursor after handling each page, so a restart carries on where it stopped:
string? cursor = LoadSavedCursor(); // null the first time: the feed starts at "now"
await foreach (var page in fin.Copy.Changes.ReadPagesAsync(cursor))
{
foreach (var change in page.Changes ?? []) Handle(change);
SaveCursor(page.Cursor);
}
ReadAllAsync streams the rows without the cursor, for when you do not need to resume.
Webhooks
FinCopy signs every webhook POST. Check it before trusting the body:
var valid = FinWebhook.Verify(secret, request.Headers["X-FinCopy-Timestamp"], rawBody, request.Headers["X-FinCopy-Signature"]);
Pass the raw request body, exactly as received. Signatures older than five minutes are refused.
Errors, retries and idempotency
- A failed call throws
FinApiExceptionwith the HTTPStatusCode, FinCopy'sCode,MessageandErrors.ErrorCodeistimeout,network,rate_limited,invalid_responseorempty_responsewhen the SDK can say why;RetryAfteris how long the API asked you to wait. - Rate limits (429) and gateway errors (502, 503, 504) are retried with back-off, honouring
Retry-Afterup to 60 seconds,MaxRetriestimes (3 by default). - Every write carries an
Idempotency-Key, generated for you or passed asidempotencyKey, and a retry reuses it, so the API applies the write once. FinClientOptions.Timeout(30 seconds) limits each attempt. When you pass your ownHttpClient, itsTimeoutapplies too.
Notes
- Server-side only. An API key reaches real trading accounts: never put it in a browser, a mobile app, source control or logs.
- Data types keep FinCopy's field names exactly (
ACNO,SYM,LOT…). An enum value this version does not know yet reads as the enum'sUnknown/UNKmember, or as null, instead of failing. - The package is not annotated for trimming or native AOT yet.
More: the quick-start example, the API reference and the repository.
| Product | Versions 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 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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. |
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.1)
- System.Text.Json (>= 8.0.6)
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.1)
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 |
|---|---|---|
| 0.14.0 | 41 | 11/23/2026 |
| 0.13.0 | 83 | 11/22/2026 |
| 0.12.0 | 95 | 11/21/2026 |
| 0.11.0 | 89 | 11/20/2026 |
| 0.10.0 | 89 | 11/19/2026 |
| 0.9.0 | 99 | 11/18/2026 |
| 0.8.0 | 101 | 11/13/2026 |
| 0.7.0 | 100 | 11/13/2026 |
| 0.6.0 | 106 | 11/12/2026 |
| 0.5.0 | 98 | 11/11/2026 |
| 0.3.0 | 98 | 11/10/2026 |
| 0.2.2 | 129 | 10/28/2026 |
| 0.2.1 | 108 | 10/26/2026 |
| 0.2.0 | 126 | 10/21/2026 |
| 0.1.1 | 108 | 10/20/2026 |
| 0.1.0 | 118 | 10/20/2026 |