api/currency

@requestnetwork/request-client.jsGlobals"api/currency"

Index

Functions

Functions

currencyToString

currencyToString(currency: ICurrency): string

Defined in request-client.js/src/api/currency.ts:80

Converts a Currency object to a readable currency string

Parameters:

NameTypeDescription
currencyICurrencyThe currency object to get the string from

Returns: string

The currency string identifier


getAllSupportedCurrencies

getAllSupportedCurrencies(): object

Defined in request-client.js/src/api/currency.ts:144

Returns an object with all the supported currency by type

Returns: object

List of all supported currencies

  • [ type: string]: Array‹object›

Const getCurrency

getCurrency(currencyValue: string, network: string): ICurrency

Defined in request-client.js/src/api/currency.ts:11

Parameters:

NameType
currencyValuestring
networkstring

Returns: ICurrency


getDecimalsForCurrency

getDecimalsForCurrency(currency: ICurrency): number

Defined in request-client.js/src/api/currency.ts:115

Returns the number of decimals for a currency

Parameters:

NameTypeDescription
currencyICurrencyThe currency

Returns: number

The number of decimals


stringToCurrency

stringToCurrency(currencyString: string): ICurrency

Defined in request-client.js/src/api/currency.ts:50

Returns a Currency object from a user-friendly currency string. The string format is: [CURRENCY_NAME]-[network]. The network is optional. E.g: BTC, ETH, ETH-rinkeby, SAI, USD, EUR

Parameters:

NameTypeDescription
currencyStringstringThe currency string to be formatted

Returns: ICurrency