MCPcopy Create free account
hub / github.com/ElementsProject/lightning / add_default_sources

Function add_default_sources

plugins/currencyrate-plugin/src/main.rs:378–430  ·  view source on GitHub ↗
(result: &mut Vec<Source>, has_proxy: bool)

Source from the content-addressed store, hash-verified

376}
377
378fn add_default_sources(result: &mut Vec<Source>, has_proxy: bool) {
379 let coingecko = Source::new(
380 "coingecko",
381 "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies={currency_lc}",
382 vec!["bitcoin", "{currency_lc}"],
383 );
384 result.push(coingecko);
385
386 let kraken = Source::new(
387 "kraken",
388 "https://api.kraken.com/0/public/Ticker?pair=XXBTZ{currency}",
389 vec!["result", "XXBTZ{currency}", "c", "0"],
390 );
391 result.push(kraken);
392
393 let blockchain_info = Source::new(
394 "blockchain.info",
395 "https://blockchain.info/ticker",
396 vec!["{currency}", "last"],
397 );
398 result.push(blockchain_info);
399
400 if !has_proxy {
401 let bitstamp = Source::new(
402 "bitstamp",
403 "https://www.bitstamp.net/api/v2/ticker/btc{currency_lc}",
404 vec!["last"],
405 );
406 result.push(bitstamp);
407 }
408
409 let coindesk = Source::new(
410 "coindesk",
411 "https://data-api.coindesk.com/index/cc/v1/latest/tick\
412 ?market=cadli&instruments=BTC-{currency}&apply_mapping=true",
413 vec!["Data", "BTC-{currency}", "VALUE"],
414 );
415 result.push(coindesk);
416
417 let coinbase = Source::new(
418 "coinbase",
419 "https://api.coinbase.com/v2/prices/BTC-{currency}/spot",
420 vec!["data", "amount"],
421 );
422 result.push(coinbase);
423
424 let binance = Source::new(
425 "binance",
426 "https://data-api.binance.vision/api/v3/ticker/price?symbol=BTC{currency}",
427 vec!["price"],
428 );
429 result.push(binance);
430}

Callers 1

gather_sourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected