current-bitcoin-price 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchCurrentPrice.d.ts","sourceRoot":"","sources":["../../src/price/fetchCurrentPrice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"fetchCurrentPrice.d.ts","sourceRoot":"","sources":["../../src/price/fetchCurrentPrice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD,KAAK,uBAAuB,GAAG;IAC7B,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;AAKF,eAAO,MAAM,iBAAiB,GAAU,eAErC,uBAAuB,0DAMzB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { PriceProviders } from './PriceProviders.js';
|
|
2
2
|
import { createPriceProvider } from './createPriceProvider.js';
|
|
3
3
|
import { FIAT } from '../types.js';
|
|
4
|
+
// ROADMAP: implement method to query a different provider when 429 too many requests
|
|
5
|
+
// should be configurable in the Params
|
|
4
6
|
export const fetchCurrentPrice = async ({ provider, }) => {
|
|
5
7
|
const pricingProvider = createPriceProvider(provider || PriceProviders.COINGECKO);
|
|
6
8
|
return await pricingProvider.getCurrentPrice(FIAT.USD);
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "current-bitcoin-price",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Get current Bitcoin price in USD/EUR from CoinGecko, Binance & more. 1-line API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"import": "./dist/index.js"
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
10
12
|
}
|
|
11
13
|
},
|
|
12
14
|
"keywords": [
|