bitpanda_price_ticker 0.2.1 copy "bitpanda_price_ticker: ^0.2.1" to clipboard
bitpanda_price_ticker: ^0.2.1 copied to clipboard

discontinued

Dart client to consume Bitpanda's price ticker API. BTC, ETH, PAN (and many more) prices.

bitpanda_price_ticker #

A Dart client to wrap Bitpanda's price ticker API.

You can read more about Bitpanda's public APIs in the docs, or see the API this library gives access to in action, directly in your browser

This is not an official Bitpanda plugin.

Build Status

Usage #

import 'package:bitpanda_price_ticker/bitpanda_price_ticker.dart';
import 'package:http/http.dart';

Future<void> main() async {
  // Provide a (http) Client to the fetch function
  final Map<String, Map<String, String>> map = await fetch(client: Client());
  final List<String> responseKeys = map.keys.toList()..sort();
  print('Bitpanda API supports ${responseKeys.length} cryptocurrencies.');
  print('This dart package supports ${supportedCryptocurrencies.length} crypocurrencies');

  // You can use the map values directly with strings
  // This map will include all cryptocurrencies returned from the
  // Bitpanda price ticker API
  final double btc2usd = double.parse(map['BTC']['USD']);
  print('BTC is worth approximately $btc2usd USD.');

  // You can use the readEntry convenience function in case you don't
  // know every supported cryptocurrency and currency.
  final double best2eur = double.parse(readEntry(map, Cryptocurrency.BEST, Currency.EUR));
  final double pan2eur = double.parse(readEntry(map, Cryptocurrency.PAN, Currency.EUR));
  final double walletValue = 8800 * best2eur + 16e3 * pan2eur;
  print('My wallet\'s current value is $walletValue EUR.');
}

Examples #

Flutter #

Screenshot of example app: list of cryptocurrencies with their latest price in USD

Contribute #

If you'd like to contribute to this package, see the Contributions guidelines.

3
likes
40
pub points
0%
popularity

Publisher

verified publisherdartside.dev

Dart client to consume Bitpanda's price ticker API. BTC, ETH, PAN (and many more) prices.

Repository (GitHub)
View/report issues
Contributing

License

Apache-2.0 (LICENSE)

Dependencies

http

More

Packages that depend on bitpanda_price_ticker