ABCExchangeCache Class Reference

Inherits from NSObject
Declared in ABCExchangeCache.h

Overview

ABCExchangeCache provides conversion routines to convert from any fiat currency to BTC in satoshis or vice version. This object uses the exchange rate source set it ABCSettings. Exchange values are cached globally and shared between all incoming requests.

– satoshiToCurrency:currencyCode:error:

Convert bitcoin amount in satoshis to a fiat currency amount

- (double)satoshiToCurrency:(uint64_t)satoshi currencyCode:(NSString *)currencyCode error:(NSError **)error

Parameters

satoshi

uint_64t amount to convert in satoshis

currencyCode

NSSTring* ISO currency code of fiat currency to convert to. ie “USD, CAD, EUR”

error

NSError** pointer to NSError object

Return Value

double resulting fiat currency value

Discussion

Convert bitcoin amount in satoshis to a fiat currency amount

Declared In

ABCExchangeCache.h

– currencyToSatoshi:currencyCode:error:

Convert fiat currency amount to a bitcoin amount in satoshis

- (uint64_t)currencyToSatoshi:(double)currency currencyCode:(NSString *)currencyCode error:(NSError **)error

Parameters

currency

(double) Amount in fiat value to convert

currencyCode

NSString* ISO currency code of fiat currency to convert to. ie “USD, CAD, EUR”

error

NSError** pointer to NSError object

Return Value

uint_64t Resulting value in satoshis

Discussion

Convert fiat currency amount to a bitcoin amount in satoshis

Declared In

ABCExchangeCache.h