helium_api_client 1.0.0 copy "helium_api_client: ^1.0.0" to clipboard
helium_api_client: ^1.0.0 copied to clipboard

A client for consuming the Helium APIs (https://docs.helium.com/api/).

Helium API Client Library for Dart #

Provides a client for the Helium API in the Dart language.

Currently, it supports 3 sections of the Blockchain API: Hotspots, Oracle Prices, and Transactions.

Usage #

Get a client instance:

final client = HeliumBlockchainClient();

You can make API calls on the methods of:

  • client.hotspots
  • client.prices
  • client.transactions

API calls return a HeliumResponse object. You can get the results from the data property on the response.

final client = HeliumBlockchainClient();
var resp = await client.prices.getCurrent();
print(resp.data.price);

If the API is paged, it returns a HeliumPagedResponse. To get the next page of results (also a HeliumPagedResponse object), call getNextPage passing the previous page response:

final client = HeliumBlockchainClient();
var resp = await client.prices.getCurrentAndHistoric();
print(resp.data.length);
resp = await client.getNextPage(resp);
print(resp.data.length);
resp = await client.getNextPage(resp);
print(resp.data.length);
// ...

There is no need to close or destroy any objects when done.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Contributing to this library #

Run tests (does code generation) #

dart run build_runner test

Generate Code #

dart run build_runner build
1
likes
130
pub points
0%
popularity

Publisher

verified publisherjamesdobson.name

A client for consuming the Helium APIs (https://docs.helium.com/api/).

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

http, json_annotation

More

Packages that depend on helium_api_client