MainLibProj_Hrithik 2.2.0

dotnet add package MainLibProj_Hrithik --version 2.2.0
                    
NuGet\Install-Package MainLibProj_Hrithik -Version 2.2.0
                    
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="MainLibProj_Hrithik" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MainLibProj_Hrithik" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="MainLibProj_Hrithik" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MainLibProj_Hrithik --version 2.2.0
                    
#r "nuget: MainLibProj_Hrithik, 2.2.0"
                    
#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.
#:package MainLibProj_Hrithik@2.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MainLibProj_Hrithik&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=MainLibProj_Hrithik&version=2.2.0
                    
Install as a Cake Tool

🧱 Installation

Install via NuGet Package Manager:

dotnet add package MainLibProj_Hrithik

Or using the Visual Studio Package Manager Console:

Install-Package MainLibProj_Hrithik

🆕 MainLibProj_Hrithik — FIX Protocol Support (Latest Release)

🚀 New in v2.2.0: We’ve integrated FIX protocol connectivity using QuickFIX/n directly into this library! Now you can send Equity, Fractional, Notional, Option, and Multi-Leg orders seamlessly over FIX — all through simple JSON-based method calls.

⚙️ How It Works

You can now initialize a FIX session and send trade orders without worrying about low-level FIX message structures. The library automatically handles session management, authentication, and message creation using QuickFIX/n under the hood.

🧩 Usage Example using MainLibProj_Hrithik.Fix; using System.Text.Json;

// Step 1: Configure FIX Connection var config = new FixConnectionConfig { // Required: Session identifiers SenderCompId = "", TargetCompId = "",

// Optional: Sub IDs
SenderSubId = "YOUR_SENDER_SUB_ID",
TargetSubId = "TARGET_SUB_ID",

// Optional: Authentication
Username = "YOUR_USERNAME",
Password = "YOUR_PASSWORD",

// Required: FIX configuration file path
FixSettingsFilePath = "path/to/fix.cfg",

// Certificate options
CertificatePath = "C:\\path\\to\\certificate.cer",
CertificatePassword = "cert_password_if_any",

// Connection settings
HostName = "your.fixserver.com",
Port = 12345,
ProxyPort = 15000,
HeartbeatInterval = 30,
ResponseTimeoutSeconds = 20

};

// Step 2: (Optional) Load certificate from Azure Key Vault var configWithKeyVault = new FixConnectionConfig { SenderCompId = "YOUR_SENDER_COMP_ID", TargetCompId = "FIX_TARGET_COMP_ID", Username = "YOUR_USERNAME", Password = "YOUR_PASSWORD", FixSettingsFilePath = "path/to/fix.cfg",

// Azure Key Vault integration
KeyVaultUrl = "https://your-keyvault.vault.azure.net/",
CertificateName = "fixcert"

};

// Step 3: Initialize FIX Gateway Client using var client = new FixJsonGatewayClient(config, null); await client.InitializeAsync();

// Step 4: Send Orders await SendEquityOrder(client); await SendFractionalOrder(client); await SendOptionOrder(client); await SendMultiLegOrder(client); await CancelOrder(client); await ReplaceOrder(client);

🧾 Example: Send an Equity Order static async Task SendEquityOrder(FixJsonGatewayClient client) { Console.WriteLine("\n=== Sending Equity Order ===");

var request = new FixJsonRequest
{
    MessageType = "NewOrderSingle",
    Fields = new Dictionary<string, object>
    {
        { "ClOrdID", "ORDER-" + Guid.NewGuid() },
        { "Symbol", "AAPL" },
        { "Side", "1" },          // Buy
        { "OrdType", "2" },       // Limit
        { "OrderQty", 100 },
        { "Price", 150.50 },
        { "Account", "YOUR_ACCOUNT_NUMBER" },
        { "TimeInForce", "0" },   // Day
        { "Currency", "USD" },
        { "SecurityType", "CS" }, // Common Stock
        { "ExDestination", "NASDAQ" },
        { "Rule80A", "I" }        // Individual
    }
};

var response = await client.SendMessageAsync(request);

Console.WriteLine($"Status: {response.Status}");
Console.WriteLine($"Response: {JsonSerializer.Serialize(response.Fields, new JsonSerializerOptions { WriteIndented = true })}");

if (response.Status == "Rejected")
    Console.WriteLine($"Error: {response.ErrorMessage}");

}

💡 Supported Order Types Type Method Equity SendEquityOrder() Fractional SendFractionalOrder() Option SendOptionOrder() Multi-Leg SendMultiLegOrder() Cancel CancelOrder() Replace ReplaceOrder() 🔐 Key Features

✅ Native QuickFIX/n integration

✅ Supports Azure Key Vault certificates

✅ JSON-based order structure for easy integration

✅ Plug-and-play FIX connectivity

✅ Built for Equity, Fractional, Notional, Option, and Multi-leg orders

🧠 OTHER Usage Examples 📦 Upload File to Azure Blob Storage using MainLibProj_Hrithik.AzureHelpers;

var connectionString = "DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...;EndpointSuffix=core.windows.net;"; var containerName = "uploads"; var filePath = "C:\Users\Hrithik\Documents\data.json";

await BlobHelper.UploadFileAsync(connectionString, containerName, filePath); Console.WriteLine("✅ File uploaded successfully!");

🔑 Retrieve Secret from Azure Key Vault using MainLibProj_Hrithik.AzureHelpers;

var secretValue = await KeyVaultHelper.GetSecretAsync("https://myvault.vault.azure.net/", "StorageAccountKey"); Console.WriteLine($"🔒 Secret value: {secretValue}");

📊 Convert Excel File to JSON using MainLibProj_Hrithik.Converters;

var excelFilePath = "C:\Data\Orders.xlsx"; var json = ExcelConverter.ConvertToJson(excelFilePath);

Console.WriteLine(json);

📝 Convert Word Document to PDF using MainLibProj_Hrithik.Converters;

var docxPath = "C:\Docs\Invoice.docx"; var pdfPath = "C:\Docs\Invoice.pdf";

WordToPdfConverter.Convert(docxPath, pdfPath); Console.WriteLine("📄 PDF created successfully!");

🧰 Tech Stack

.NET 8.0

Azure SDK for .NET

OpenXML SDK

PdfSharpCore

Newtonsoft.Json

🪪 License

This project is licensed under the MIT License — feel free to use, modify, and distribute it.

💬 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve features or fix bugs.

📧 Contact

Author: Hrithik Email: hrithikkalra11@gmail.com

NuGet: MainLibProj_Hrithik

Support my work
If you find this package helpful, consider buying me a coffee ❤️
👉 Buy Me a Coffee

Product Compatible and additional computed target framework versions.
.NET 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. 
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
2.2.0 263 11/14/2025
2.1.9 272 11/13/2025
2.1.8 191 11/4/2025
2.1.7 189 11/4/2025
2.1.6-Preview 270 11/4/2025 2.1.6-Preview is deprecated because it has critical bugs.
2.1.5-Preview 256 11/4/2025 2.1.5-Preview is deprecated because it has critical bugs.
2.1.4 187 11/4/2025
2.1.2 181 10/30/2025
2.0.2 172 10/15/2025
2.0.1 179 10/13/2025
2.0.0 156 10/12/2025

Version 2.2.0:
- Changes to include all Fix4.2 Custom header dynamically to be more generic.