Finance::Bank::Kraken - api.kraken.com connector
0.3
require Finance::Bank::Kraken; $api = new Finance::Bank::Kraken; $api->key($mykrakenkey); $api->secret($mykrakensecret); $result = $api->call(Private, $method, [$arg1, $arg2, ..]);
This module allows to connect to the api of the bitcoin market Kraken.
Please see the Kraken API documentation for a catalog of api methods.
The constructor. Returns a Finance::Bank::Kraken object.
Finance::Bank::Kraken
Sets or gets the API key.
Sets the API secret to $secret or returns the API secret base64 decoded.
$secret
Calls the Public or Private API method $method (with the given $params, where applicable) and returns either the JSON encoded result string or an error message (code message).
Public
Private
$method
$params
code
message
use Finance::Bank::Kraken; use JSON; my $kraken = new Finance::Bank::Kraken; my $res = $kraken->call(Public, 'Ticker', ['pair=XLTCZEUR,XXBTZEUR']); printf "1 XLTC is %f EUR\n", from_json($res)->{'result'}->{'XLTCZEUR'}->{'c'}[0] unless $res =~ /^5/;
use Finance::Bank::Kraken; use JSON; my $kraken = new Finance::Bank::Kraken; $kraken->key("mysupersecretkey"); $kraken->secret("mysupersecretsecret"); my $res = $kraken->call(Private, 'Balance'); printf "balance: %f XLTC\n", from_json($res)->{'result'}->{'XLTC'} unless $res =~ /^5/;
call
Probably you misspelled the method. Please check the API documentation and keep in mind the methods are case sensitive.
Maybe there's a problem with the ssl chain of trust. Either install Mozilla::CA or set (one of) the following environment variables PERL_LWP_SSL_CA_FILE, HTTPS_CA_FILE, PERL_LWP_SSL_CA_PATH, HTTPS_CA_DIR. See LWP::UserAgent for details.
PERL_LWP_SSL_CA_FILE
HTTPS_CA_FILE
PERL_LWP_SSL_CA_PATH
HTTPS_CA_DIR
Copyright Philippe Kueck <projects at unixadm dot org>
To install Finance::Bank::Kraken, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::Bank::Kraken
CPAN shell
perl -MCPAN -e shell install Finance::Bank::Kraken
For more information on module installation, please visit the detailed CPAN module installation guide.