ISOCodex.Currency.Exchange.Abstractions 1.0.2

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

ISOCodex.Currency.Exchange.Abstractions

Provider-neutral deterministic exchange-rate abstractions for ISOCodex.Currency.

Install

dotnet add package ISOCodex.Currency.Exchange.Abstractions --version 1.0.2

Scope

This package defines the exchange-rate contracts and a direct-rate MoneyConverter. It deliberately does not include a live exchange-rate provider and does not make network calls. Applications supply rates from their own approved source, such as an audited database, file import, internal policy table, or a separately reviewed provider package.

The initial converter supports direct rates only. Inverse, triangulated, cached, and live-provider behaviours are future package work.

Example

using ISOCodex.Currency;
using ISOCodex.Currency.Exchange.Abstractions;

var effectiveDate = new DateTime(2026, 6, 22, 0, 0, 0, DateTimeKind.Utc);
var rate = new ExchangeRate(
    new CurrencyPair(CurrencyCode.GBP, CurrencyCode.USD),
    1.2345m,
    ExchangeRateKind.MidMarket,
    effectiveDate,
    "finance-approved-rates.csv");

IExchangeRateProvider provider = new InMemoryExchangeRateProvider(rate);
var converter = new MoneyConverter(provider);

var result = converter.Convert(
    Money.Of(10.00m, CurrencyCode.GBP),
    new ConversionOptions(
        CurrencyCode.USD,
        effectiveDate,
        ExchangeRateKind.MidMarket,
        CurrencyRoundingPolicy.AwayFromZero()));

Console.WriteLine(result.RawAmount);     // 12.345000
Console.WriteLine(result.RoundedAmount); // 12.35
Console.WriteLine(result.Output);        // USD 12.35
Console.WriteLine(result.RateSource);    // finance-approved-rates.csv

A minimal provider can be implemented in application code:

public sealed class InMemoryExchangeRateProvider : IExchangeRateProvider
{
    private readonly ExchangeRate _rate;

    public InMemoryExchangeRateProvider(ExchangeRate rate)
    {
        _rate = rate;
    }

    public ExchangeRateLookupResult GetRate(
        CurrencyPair pair,
        DateTime effectiveDate,
        ExchangeRateKind rateKind)
    {
        if (_rate.Pair == pair && _rate.EffectiveDate == effectiveDate && _rate.Kind == rateKind)
        {
            return ExchangeRateLookupResult.Success(_rate);
        }

        return ExchangeRateLookupResult.Failure(
            ExchangeRateLookupFailureReason.RateUnavailable,
            $"No rate for {pair} on {effectiveDate:O}.");
    }
}

Audit behaviour

ConversionResult includes:

  • input money;
  • output money;
  • direct rate used;
  • raw unrounded target amount;
  • rounded target amount;
  • requested effective date;
  • requested rate kind;
  • explicit rounding policy;
  • rate source.

This is enough for deterministic replay when the application preserves the same input, rate, effective date, rate kind, and rounding policy.

Product 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 was computed.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.0.2 105 6/23/2026
1.0.1 100 6/23/2026
1.0.0 99 6/23/2026
0.9.0-alpha.15 55 6/23/2026
0.9.0-alpha.14 55 6/23/2026
0.9.0-alpha.13 58 6/23/2026
0.9.0-alpha.12 54 6/23/2026
0.9.0-alpha.11 53 6/23/2026
0.9.0-alpha.10 57 6/23/2026
0.9.0-alpha.9 54 6/22/2026
0.9.0-alpha.8 58 6/22/2026
0.9.0-alpha.7 67 6/22/2026
0.9.0-alpha.6 58 6/22/2026
0.9.0-alpha.5 59 6/22/2026
0.9.0-alpha.4 58 6/22/2026
0.9.0-alpha.2 63 6/22/2026
0.9.0-alpha.1 55 6/22/2026
0.1.0-alpha.8 56 6/22/2026