OpenForex TVX developer toolkit
Version 0.1.0. Source code for TVX-based currency calculations, available through the official OpenForex source page and repository.
Download the source
- Download source ZIP — TypeScript, compiled JavaScript, declarations, tests, examples, build configuration, and documentation.
- Download installable npm package — a local-install tarball; no npm registry account is needed to use it.
- Download release checksums — SHA-256 hashes for both artifacts.
The package name is @openforex/tvx. The current release is distributed through these downloadable artifacts. The source repository is ASL-Dev-001/OPENFOREX on GitHub; repository access may be required. These downloads do not require repository access. This page does not advertise an npm registry release.
The applied TVX calculation
The toolkit follows the application inspected in the AFR reference converter:
target amount = source amount × V(source currency) / V(target currency)
Each instrument carries its own value on the common TVX reference scale. The pair calculation directly compares those values; it does not insert USD or another currency as an intermediate conversion base. A provider still needs a consistent, documented valuation method for the input values.
Install and run
Extract the source ZIP into a development directory, then run:
npm ci
npm test
npm run example
To consume the compiled package from another project, install the downloaded tarball:
npm install ./openforex-tvx-0.1.0.tgz
The toolkit targets Node.js 20 or later and modern browser ES-module environments. It has no runtime dependencies. TypeScript is a locked development dependency for building declarations and JavaScript.
Convert an amount
import { convert, pairRate } from '@openforex/tvx';
const result = convert({
amount: '120.00',
fromValue: '0.50',
toValue: '6.00',
decimals: 2,
rounding: 'half-even'
});
// '10.00' using synthetic teaching values.
const reverseRate = pairRate('6.00', '0.50');
// '12.00000000'
Pass decimal strings, not floating-point amounts. The core uses exact rational arithmetic and rounds only the final output. Use calculate() when you also need the exact numerator, denominator, and numeric policy in a serializable evidence record.
Available functions
| Export | Purpose |
|---|---|
| convert | Compute a target amount with explicit precision and rounding |
| calculate | Return the amount plus exact calculation evidence |
| pairRate | Calculate a direct rate for one source unit |
| createSnapshot | Validate and freeze values and their provenance |
| quote | Calculate from a snapshot after freshness checks |
| fromSapaPayload | Adapt currencies[] rows containing tvx_value and rate_quoted_at |
| structuralValue | Evaluate the inspected weighted-power structural model with explicit inputs |
| TvxError | Report stable error codes for invalid data or policy |
The source archive includes docs/API.md with full types, limits, return fields, and error codes, and docs/INTEGRATION.md with feed and exchange integration guidance.
Connect a provider snapshot
import { fromSapaPayload, quote } from '@openforex/tvx';
const snapshot = fromSapaPayload(providerPayload, {
id: providerSnapshotId,
source: providerName,
method: valuationMethodRevision,
referenceUnit: 'TVX'
});
const result = quote({
snapshot,
amount: '120.00',
from: 'GHS',
to: 'USD',
now: quoteTimeUtc,
maxAgeMs: acceptedObservationAgeMs,
decimals: 2
});
The provider variables above come from your application. The toolkit performs no network request and reads no implicit clock. It validates each selected currency's observation time, rejects stale or future inputs, and records the snapshot and method used.
The adapter does not replace a missing TVX value with a market rate or fabricate an anchor currency. Alias mappings are explicit. Decimal strings are preferred; opting into numeric JSON inputs cannot recover precision already lost upstream.
Structural valuation
The inspected backend computes a structural value from nominal GDP, PPP GDP, population, efficiency, support, and gold-anchor terms, with normalized nonnegative exponent weights. The toolkit exposes that model through structuralValue(inputs, policy).
This function requires explicit policy parameters. It uses floating-point fractional powers and is separate from the decimal-exact conversion path. The package does not distribute institutional datasets, live coefficients, AFRA target-zone settings, or market-blending rules. Its provenance guide records the observed source behavior and intentional implementation differences.
TVX structural values are not automatically QASH-denominated prices. The input methodology must establish that relationship before a caller labels a snapshot's referenceUnit as QASH.
Exchange integration boundaries
Use this toolkit for reference calculations, provider adapters, research, and application integration. Your exchange application remains responsible for bid/ask spreads, fees, liquidity, authentication, order execution, accounting, and settlement. The SDK does not turn a calculated reference amount into an executable order or guarantee a market price.
This is a software implementation resource supporting the Society's working standards. Toolkit version 0.1.0 is not a new ratification date or a certification of an adopting application's operation.
License and source integrity
The new toolkit code and its documentation are MIT licensed. The license does not extend to the inspected application, third-party data, the Society's monetary literature, or QASH symbol assets. Preserve LICENSE and NOTICE.md when redistributing the toolkit.
The archive contains no application credentials, database records, live datasets, or private deployment configuration. It includes a source-provenance hash manifest, a changelog, contribution guidance, and release instructions for later GitHub publication.
Continue with the source repository, TVX formula reference, implementation registry, and documentation HTTP API.
Source references
The SDK API contracts define numeric inputs, output precision, rounding, and error behavior. The implementation provenance records the origin and scope of the software. These are project implementation sources; synthetic arithmetic is not independent validation of a valuation methodology.
Sources & citation
- Material type
- Software reference
- Publisher
- OpenForex Society
OpenForex Society. “OpenForex TVX developer toolkit.” https://openforex.io/?page=developer%2Ftvx-sdk. Include your access date when citing.
Download the exact published MarkdownText fingerprint (SHA-256)
2961c027c895b414c82089116727f6820c714cc68ec5dc61a21943747bccd6aeThis identifies the downloadable text, not an independent approval or a permanent archived edition.
Referenced material (9)
- Download source ZIPProject reference
- Download installable npm packageProject reference
- Download release checksumsProject reference
- source repositoryProject reference
- TVX formula referenceProject reference
- implementation registryProject reference
- documentation HTTP APIProject reference
- SDK API contractsProject reference
- implementation provenanceProject reference
Standards, implementation references and worked calculations identify their sources and publication status. Read our sourcing and corrections policy.
OFS-Kernel 1.0.0
Step 3 of 4 in this reading path.
Continue View the complete path