Skip to content

Latest commit

 

History

History
44 lines (26 loc) · 1.05 KB

File metadata and controls

44 lines (26 loc) · 1.05 KB

rates-api v3.0.0


rates-api / src/services/zelcoreRatesV2 / default

Variable: default

default: object

Defined in: src/services/zelcoreRatesV2.ts:153

Type Declaration

getAll

getAll: () => Promise<PricesResponse>

Fetches and aggregates cryptocurrency prices and fiat rates from multiple providers.

This function retrieves fiat rates from BitPay and cryptocurrency prices from CoinGecko, CryptoCompare, and LiveCoinWatch. It handles errors from each provider and compiles the data into a unified PricesResponse object.

Returns

Promise<PricesResponse>

An object containing crypto prices, fiat rates, and any errors encountered.

Async

Example

import zelcoreRatesV2 from './zelcoreRatesV2';

async function fetchPrices() {
  const prices = await zelcoreRatesV2.getAll();
  console.log('Prices:', prices);
}

fetchPrices();