HawkN.Iso.Currencies 8.0.1

dotnet add package HawkN.Iso.Currencies --version 8.0.1
                    
NuGet\Install-Package HawkN.Iso.Currencies -Version 8.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="HawkN.Iso.Currencies" Version="8.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HawkN.Iso.Currencies" Version="8.0.1" />
                    
Directory.Packages.props
<PackageReference Include="HawkN.Iso.Currencies" />
                    
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 HawkN.Iso.Currencies --version 8.0.1
                    
#r "nuget: HawkN.Iso.Currencies, 8.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.
#:package HawkN.Iso.Currencies@8.0.1
                    
#: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=HawkN.Iso.Currencies&version=8.0.1
                    
Install as a Cake Addin
#tool nuget:?package=HawkN.Iso.Currencies&version=8.0.1
                    
Install as a Cake Tool

HawkN.Iso.Currencies

HawkN.Iso.Currencies provides ISO 4217 currency codes, historical currency data, and replacement mappings.

Features

  • Actual currency list - Provides a complete and up-to-date set of currency codes and their details according to the ISO 4217 standard.
  • Strongly typed currency codesCurrencyCode enum is generated at compile-time.
  • Historical currency support – Access withdrawn currencies.
  • Lightweight & Dependency-Free – Minimal overhead, compatible with .NET 8 and above.
  • Integration ready – Use in libraries, console apps, or web applications.

Getting Started

Install via NuGet

dotnet add package HawkN.Iso.Currencies

Required Namespaces

using HawkN.Iso.Currencies;
using HawkN.Iso.Currencies.Abstractions;
using HawkN.Iso.Currencies.Models;
using HawkN.Iso.Currencies.Extensions;

Usage Example

Registration

Use extension method .AddCurrencyService();

using var host = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        services.AddCurrencyService();
    })
    .Build();

To get service instance:

var currencyService = scope.ServiceProvider.GetRequiredService<ICurrencyService>();

or inject

app.MapGet("/weatherforecast", ([FromServices] ICurrencyService currencyService) => ...
Get all existing currencies
var currencyService = scope.ServiceProvider.GetRequiredService<ICurrencyService>();
var currencies = currencyService?.Query()
    .Includes
        .Type(CurrencyType.Fiat)
        .Type(CurrencyType.SpecialUnit)
        .Type(CurrencyType.SpecialReserve)
        .Type(CurrencyType.PreciousMetal)
   .Build();
Get fiat currencies
var currencyService = scope.ServiceProvider.GetRequiredService<ICurrencyService>();
var currencies = currencyService?.Query()
   .Includes
        .Type(CurrencyType.Fiat)
   .Build();
Get currencies by query

Excludes EUR and USD from the list:

var currencies = currencyService?.Query()
   .Includes
        .Type(CurrencyType.Fiat)
   .Without(w => w.Codes(nameof(CurrencyCode.EUR), nameof(CurrencyCode.USD)))
   .Build();

Includes only EUR and USD in the list:

var currencies = currencyService?.Query()
   .Includes
        .Type(CurrencyType.Fiat)
   .With(w => w.Codes("EUR", "usd"))
   .Build();
Get currencies by advanced query (LINQ)

Includes only EUR and USD in the list:

var currencies = currencyService?.Query()
   .Includes
        .Type(CurrencyType.Fiat)
   .Where(q => q.Code is "EUR" or nameof(CurrencyCode.USD))
   .Build();
Get historical currencies
var historical = currencyService.GetAllHistorical();
foreach (var currency in historical)
{
    Console.WriteLine($"{currency.Code} - {currency.Name} (Withdrawn: {currency.WithdrawnOn})");
}
Lookup currency

By string code

var afnWithString = currencyService.Get("AFN");

By currency code

var afnWithCode = currencyService.Get(CurrencyCode.AFN);
Validate currency

By string code

var validResult = currencyService.TryValidate("AFN", out var validateResult);

By currency code

var validResult = currencyService.TryValidate(CurrencyCode.AFN, out var validateResult);

Supported currencies

See the currency list with the link Last updated at 16.01.2026


Generated Types

  • CurrencyCode – strongly-typed enum with all ISO 4217 codes.
  • Currency – domain model representing a currency (code, name, numeric code, withdrawn date).

License

Code

This project’s source code is licensed under the MIT License.

Data

This project uses data derived from the following sources:

The above data licenses are permissive and compatible with MIT-licensed code
when used for reference and code generation.

See DATA-LICENSE for details.


References

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.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on HawkN.Iso.Currencies:

Package Downloads
HawkN.Iso.Countries.Currencies

Provides mapping between countries and currencies (primary and secondary). Includes extension methods to query primary, secondary, or all currencies and check usage.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.1 453 1/16/2026
8.0.0 161 1/4/2026

- Added support for .NET 8.0
           - Strongly typed CurrencyCode enum generated at compile time
           - Lightweight & dependency-free