File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,7 @@ const CPL_API_BRIDGED_FIAT_CURRENCIES: Array<CplApiBridgedFiatCurrency> = Object
262
262
! FIAT_API_HISTORY_SUPPORTED_BRIDGED_FIAT_CURRENCIES . includes ( currency as any )
263
263
) ) ;
264
264
265
- const API_URL = 'https://api.coingecko.com/api/v3' ;
265
+ let API_URL = 'https://api.coingecko.com/api/v3' ;
266
266
const COINGECKO_COIN_IDS = {
267
267
[ FiatApiSupportedCryptoCurrency . NIM ] : 'nimiq-2' ,
268
268
[ FiatApiSupportedCryptoCurrency . BTC ] : 'bitcoin' ,
@@ -274,6 +274,13 @@ const ONE_MINUTE = 60 * 1000;
274
274
const ONE_HOUR = 60 * ONE_MINUTE ;
275
275
const ONE_DAY = 24 * ONE_HOUR ;
276
276
277
+ /**
278
+ * @param url The URL to the Coingecko v3 API. Defaults to https://api.coingecko.com/api/v3.
279
+ */
280
+ export function setCoingeckoApiUrl ( url : string ) {
281
+ API_URL = url ;
282
+ }
283
+
277
284
type VsCurrency = FiatApiSupportedFiatCurrency | FiatApiBridgedFiatCurrency | FiatApiSupportedCryptoCurrency ;
278
285
export async function getExchangeRates < C extends FiatApiSupportedCryptoCurrency , V extends VsCurrency > (
279
286
cryptoCurrencies : C [ ] ,
You can’t perform that action at this time.
0 commit comments