Bodu.Financial.ExchangeRates.Ofx 0.7.1

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

Bodu.Financial.ExchangeRates.Ofx

API stability — Preview. The public API surface is largely settled but is still being finalized ahead of the 1.0 release and may change; breaking changes can land in a minor version until then.

A Bodu.Financial exchange-rate provider backed by OFX's (ofx.com) spot-rate history, queried from their public JSON endpoint.

Unlike the central-bank providers, OFX serves arbitrary ISO currency pairs, so OfxRateProvider derives from the arbitrary-pair PairWebRateProvider base: it fetches a pair's history over a date range on demand and serves the results as Bodu.Financial.ExchangeRates.ExchangeRate values through the standard IDatedRateProvider and IRateProvider contracts — so it composes with Money.ConvertTo, the caching and aggregating providers, and the rest of the Bodu.Financial FX stack.

using Bodu.Financial.ExchangeRates;

// The provider builds and owns its HttpClient from the options; dispose it to release the client.
using var provider = new OfxRateProvider(new OfxRateProviderOptions());

RateRangeResult series =
    await provider.GetRatesAsync("AUD", "USD", new DateOnly(2026, 1, 1), new DateOnly(2026, 6, 12));

RateLookupResult latest = provider.GetRate("AUD", "USD", new DateOnly(2026, 6, 12));

Behaviour

  • Arbitrary pairs. Any ISO 4217 pair OFX publishes is resolvable directly; the reverse direction is inverted from the fetched series.
  • Range queries. History is fetched per pair over a date range and accumulated, with per-pair coverage tracking and single-flight coalescing inherited from the pair base, so concurrent lookups for the same pair share one download.
  • Configuration. OfxRateProviderOptions carries working defaults and binds through Microsoft.Extensions.Options. The package ships its own AddOfxExchangeRates registration in the Bodu.Financial.ExchangeRates namespace.

HTTP client and lifetime

The provider is IDisposable and offers two construction styles: new OfxRateProvider(options, ...) — the provider builds, owns, and disposes its own HttpClient — and new OfxRateProvider(httpClient, options, ...) — you supply the client and own its lifetime. The second form is what the DI registration uses, backed by IHttpClientFactory.

Logging

The provider logs through Microsoft.Extensions.Logging. Pass an ILogger to the constructor, or let the DI registration wire one for you; when no logger is supplied it defaults to NullLogger.Instance, so logging is opt-in and free when unused.

Part of the Bodu utility library.

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 is compatible.  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
0.7.1 55 9/24/2026
0.7.0 113 9/24/2026