UNPKG

react-native-bitcoin-tools

Version:

A set of helpers for interacting with Bitcoin and Blockchain data.

16 lines (15 loc) 511 B
"use strict"; const endpoint = 'https://kibo.money/api/sth-realized-price'; async function getSTHRealizedPrice() { try { const priceResponse = await fetch(endpoint); const priceData = await priceResponse.text(); const price = Number(priceData.split('.')[0] ?? -1); return Promise.resolve(Number(price)); } catch (error) { console.log('[BitcoinTools ERROR] ', error); return Promise.reject(error); } } export { getSTHRealizedPrice }; //# sourceMappingURL=getSTHRealizedPrice.js.map