Last updated:
0 purchases
kraken api
Kraken API #
Dart Library for the Kraken API. (https://www.kraken.com/features/api).
Getting Started #
Add the package to your pubspec.yaml:
kraken_api: ^2.0.0
copied to clipboard
In your dart file, import the library:
import 'package:kraken_api/kraken_api.dart';
copied to clipboard
Usage #
First create an KrakenApi instance:
KrakenApi api = KrakenApi('apiKey', 'secretKey');
copied to clipboard
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:
Future<String> response = api.call(Methods.TRADE_BALANCE, parameters: {'asset': 'ZEUR'});
copied to clipboard
Hint: To see which parameters can be applied to which API calls take a look at the Kraken API.
The call method returns the response body as an Future<String> which can be accessed through e.g.:
response.then(
(body) {
Map<String, dynamic> tradeBalances = jsonDecode(body)['result'];
return tradeBalances;
},
);
copied to clipboard
API #
Public methods:
Methods.TIME
Methods.ASSETS
Methods.ASSET_PAIRS
Methods.TICKER
Methods.OHLC
Methods.DEPTH
Methods.TRADES
Methods.SPREAD
copied to clipboard
Private methods:
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
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.