https://github.com/dimibe/kraken_api
Dart Library for the Kraken API (https://www.kraken.com/features/api)
https://github.com/dimibe/kraken_api
dart dart-package kraken-exchange-api
Last synced: about 2 months ago
JSON representation
Dart Library for the Kraken API (https://www.kraken.com/features/api)
- Host: GitHub
- URL: https://github.com/dimibe/kraken_api
- Owner: Dimibe
- License: mit
- Created: 2019-08-25T08:50:59.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2021-08-01T11:31:47.000Z (almost 5 years ago)
- Last Synced: 2023-08-20T22:29:17.225Z (almost 3 years ago)
- Topics: dart, dart-package, kraken-exchange-api
- Language: Dart
- Homepage: https://pub.dev/packages/kraken_api/
- Size: 23.4 KB
- Stars: 0
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Kraken API
[](https://pub.dev/packages/kraken_api)

Dart Library for the Kraken API. (https://www.kraken.com/features/api).
## Getting Started
Add the package to your pubspec.yaml:
```yaml
kraken_api: ^2.0.0
```
In your dart file, import the library:
```Dart
import 'package:kraken_api/kraken_api.dart';
```
## Usage
First create an `KrakenApi` instance:
```Dart
KrakenApi api = KrakenApi('apiKey', 'secretKey');
```
The constructor requires the API-Key and the Secret-Key which should be both generated on the kraken website.
For accessing the kraken API use the `call` method.
As the first parameter pass the method which should be called. A list of all available requests is added at the end.
Request parameters can be added to the request by the `parameters` parameter:
```Dart
Future response = api.call(Methods.TRADE_BALANCE, parameters: {'asset': 'ZEUR'});
```
Hint: To see which parameters can be applied to which API calls take a look at the [Kraken API](https://www.kraken.com/features/api).
The `call` method returns the response body as an `Future` which can be accessed through e.g.:
```Dart
response.then(
(body) {
Map tradeBalances = jsonDecode(body)['result'];
return tradeBalances;
},
);
```
## API
Public methods:
```Dart
Methods.TIME
Methods.ASSETS
Methods.ASSET_PAIRS
Methods.TICKER
Methods.OHLC
Methods.DEPTH
Methods.TRADES
Methods.SPREAD
```
Private methods:
```Dart
Methods.BALANCE
Methods.TRADE_BALANCE
Methods.OPEN_ORDERS
Methods.CLOSED_ORDERS
Methods.QUERY_ORDERS
Methods.TRADES_HISTORY
Methods.QUERY_TRADES
Methods.OPEN_POSITIONS
Methods.LEDGERS
Methods.QUERY_LEDGERS
Methods.TRADE_VOLUME
Methods.ADD_EXPORT
Methods.EXPORT_STATUS
Methods.RETRIEVE_EXPORT
Methods.REMOVE_EXPORT
Methods.ADD_ORDER
Methods.CANCEL_ORDER
```