Table of Contents

OandaRateProviderOptions Class

Definition

Namespace
Bodu.Financial.ExchangeRates
Assembly
Bodu.Financial.ExchangeRates.Oanda.dll
Package
Bodu.Financial.ExchangeRates.Oanda 0.7.1 (not published on nuget.org)
Source
OandaRateProviderOptions.cs

Configures how the OandaRateProvider addresses and interprets the OANDA Historical Currency Converter rate-history service.

public sealed class OandaRateProviderOptions : WebRateProviderOptions
Inheritance
OandaRateProviderOptions
Inherited Members
Extension Methods

Remarks

This type derives from WebRateProviderOptions, which supplies the endpoint base address, the HTTP contract, the synchronous-access and look-back behaviour, the currency-alias map, and the per-concern log levels. The members declared here are OANDA-specific: the data and priming paths, the rate source, the price basis, the reporting period, and the rate adjustment. The anonymous endpoint serves only a rolling recent window, so the constructor sets HistoryAvailability to a 180-day rolling window and the response is range-filtered to the requested dates.

Every member carries a working default, so the options bind cleanly through Microsoft.Extensions.Options and require no configuration for the common case. The dependency-injection package binds this type from configuration and a configure delegate.

Constructors

OandaRateProviderOptions()

Initializes a new instance of the OandaRateProviderOptions class with the OANDA Historical Currency Converter host as its base address and a 180-day rolling history window.

public OandaRateProviderOptions()

Properties

Adjustment

Gets or sets the rate adjustment requested from the OANDA endpoint.

public int Adjustment { get; set; }

Property Value

int

The adjustment query value; defaults to 0.

Period

Gets or sets the reporting period requested from the OANDA endpoint.

public string Period { get; set; }

Property Value

string

The period query value, for example daily, weekly, or monthly. Defaults to daily.

Price

Gets or sets the price basis requested from the OANDA endpoint.

public string Price { get; set; }

Property Value

string

The price query value; one of bid, mid, or ask. Defaults to mid.

PrimePath

Gets or sets the relative path requested once to obtain the session cookie the data endpoint requires.

public string PrimePath { get; set; }

Property Value

string

The priming path; defaults to the empty string, which resolves to BaseAddress.

Source

Gets or sets the rate source requested from the OANDA endpoint.

public string Source { get; set; }

Property Value

string

The source query value; defaults to OANDA (OANDA Rates).

UpdatePath

Gets or sets the relative path of the rate-history data endpoint.

public string UpdatePath { get; set; }

Property Value

string

The data path; defaults to api/data/update/.

Methods

TryValidateCore(out string?)

Validates the OANDA-specific options, ensuring the data path, source, and period are specified and the price basis is recognized.

protected override bool TryValidateCore(out string? error)

Parameters

error string

When this method returns false, a message describing the violated invariant; otherwise null.

Returns

bool

true when every OANDA-specific invariant holds; otherwise false.

Applies to

ProductVersions
.NET8, 10