mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 05:44:20 +01:00
Remove GetFiatCurrenciesAndRates snippet
This commit is contained in:
@@ -16,25 +16,3 @@ Future<Map<String, Rate>> fetchFiatRates(String lspId) async {
|
||||
// ANCHOR_END: fetch-fiat-rates
|
||||
return fiatRatesMap;
|
||||
}
|
||||
|
||||
Future<Map<FiatCurrency, Rate>> fiatCurrenciesAndRate() async {
|
||||
// ANCHOR: get-fiat-currencies-and-rates
|
||||
List<FiatCurrency> fiatCurrencies = await BreezSDK().listFiatCurrencies();
|
||||
Map<String, Rate> fiatRates = await BreezSDK().fetchFiatRates();
|
||||
|
||||
var sorted = fiatCurrencies.toList();
|
||||
sorted.sort((f1, f2) {
|
||||
return f1.id.compareTo(f2.id);
|
||||
});
|
||||
|
||||
Map<FiatCurrency, Rate> result = {};
|
||||
for (var currency in sorted) {
|
||||
var rate = fiatRates[currency.id];
|
||||
if (rate != null) {
|
||||
result[currency] = rate;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
// ANCHOR_END: get-fiat-currencies-and-rates
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user