bitpanda_price_ticker 0.2.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 54

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.

0.2.1 #

💣 Remove docs link to API Reference.

The analysis monster gives -10 points for missing link and it appears that they cannot access the API reference link (Maybe redirects?).

0.2.0 #

🚀 Simplify interfaces.

This version also includes:

  • various improvements to READMEs, docs
  • clean examples
  • better unit tests
  • travis CI automated checks

0.1.3 #

🔧 Fix documentation URL and improve READMEs

0.1.2 #

🔧 Fix unpublished g.dart files.

0.1.1 #

🚀 Add initial implementation of the package.

  • convert response to Map<String, Map<String, String>> using the fetchAsMap function, so that result can be used as: result['BTC']['USD] (better for iteration, new values are "automatically supported")
  • convert response to instance of built class using the fetch function, so that result can be used as: result.btc.usd (easier discoverability and type safety)
  • unit and integration tests
  • documentation for contributors (and for future me): how to use built_value, dartfmt, dartanalyzer, coverage for development.

0.1.0 #

😆 Initial release, a beautiful empty package!


Examples #


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

You can see the source code for the example projects on GitHub example.

This is not an official Bitpanda plugin.

Examples #

Dart from the command line #

You can see a simple Dart script in the example/server folder.

$ cd example/server
$ dart main.dart
dart main.dart                                                                                                   ✖ ✹
Bitpanda API supports 31 cryptocurrencies.
This dart package supports 31 crypocurrencies
BTC is worth approximately 10168.7 USD.
My wallet's current value is 1193.12 EUR.

Simple Flutter app #

You can see a simple Flutter app in the example/flutter folder.

$ cd example/flutter
$ flutter run

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

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  bitpanda_price_ticker: ^0.2.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:bitpanda_price_ticker/bitpanda_price_ticker.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 16, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
http ^0.12.0+2 0.12.0+4
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
coverage ^0.13.2
test ^1.6.5