fix: banano price

This commit is contained in:
julian 2023-06-08 12:21:28 -06:00
parent 80ba2a8c5c
commit 1d2d01d1de
2 changed files with 10 additions and 9 deletions

View file

@ -100,7 +100,7 @@ class PriceAPI {
Uri.parse("https://api.coingecko.com/api/v3/coins/markets?vs_currency" Uri.parse("https://api.coingecko.com/api/v3/coins/markets?vs_currency"
"=${baseCurrency.toLowerCase()}" "=${baseCurrency.toLowerCase()}"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," "&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,ban" "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"); "&order=market_cap_desc&per_page=50&page=1&sparkline=false");
final coinGeckoResponse = await client.get( final coinGeckoResponse = await client.get(
@ -115,8 +115,9 @@ class PriceAPI {
final coin = coinFromPrettyName(coinName); final coin = coinFromPrettyName(coinName);
final price = Decimal.parse(map["current_price"].toString()); final price = Decimal.parse(map["current_price"].toString());
final change24h = map["price_change_percentage_24h"] != null ? final change24h = map["price_change_percentage_24h"] != null
double.parse(map["price_change_percentage_24h"].toString()) : 0.0; ? double.parse(map["price_change_percentage_24h"].toString())
: 0.0;
result[coin] = Tuple2(price, change24h); result[coin] = Tuple2(price, change24h);
} }

View file

@ -28,7 +28,7 @@ void main() {
Uri.parse( Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids" "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids"
"=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,bitcoin-cash" "=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,bitcoin-cash"
",namecoin,wownero,ethereum,particl,nano,ban&order=market_cap_desc&per_page=50" ",namecoin,wownero,ethereum,particl,nano,banano&order=market_cap_desc&per_page=50"
"&page=1&sparkline=false"), "&page=1&sparkline=false"),
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@ -125,7 +125,7 @@ void main() {
Uri.parse( Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc" "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," "&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,ban" "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false", "&order=market_cap_desc&per_page=50&page=1&sparkline=false",
), ),
headers: {'Content-Type': 'application/json'})).called(1); headers: {'Content-Type': 'application/json'})).called(1);
@ -140,7 +140,7 @@ void main() {
Uri.parse( Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&" "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&"
"ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," "ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,ban" "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"), "&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@ -244,7 +244,7 @@ void main() {
Uri.parse( Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids" "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids"
"=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," "=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,ban" "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"), "&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: {'Content-Type': 'application/json'})).called(1); headers: {'Content-Type': 'application/json'})).called(1);
@ -258,7 +258,7 @@ void main() {
Uri.parse( Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc" "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," "&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,ban" "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"), "&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@ -361,7 +361,7 @@ void main() {
Uri.parse( Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc" "https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin," "&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,ban" "bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano"
"&order=market_cap_desc&per_page=50&page=1&sparkline=false"), "&order=market_cap_desc&per_page=50&page=1&sparkline=false"),
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'