Finance::Bitcoin::API - wrapper for the Bitcoin JSON-RPC API
use Finance::Bitcoin::API; my $uri = 'http://user:password@127.0.0.1:8332/'; my $api = Finance::Bitcoin::API->new( endpoint => $uri ); my $balance = $api->call('getbalance'); print $balance;
This module provides a low-level API for accessing a running Bitcoin instance.
new( %args )
Constructor. %args is a hash of named arguments. You need to provide the 'endpoint' URL as an argument.
call( $method, @params )
Call a method. If successful returns the result; otherwise returns undef.
endpoint
Get/set the endpoint URL.
jsonrpc
Retrieve a reference to the JSON::RPC::Client object being used. In particular $api->jsonrpc->ua can be useful if you need to alter timeouts or HTTP proxy settings.
$api->jsonrpc->ua
error
Returns the error message (if any) that resulted from the last call.
call
Please report any bugs to http://rt.cpan.org/.
Finance::Bitcoin.
http://www.bitcoin.org/.
Toby Inkster <tobyink@cpan.org>.
Copyright 2010-2011 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Finance::Bitcoin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::Bitcoin
CPAN shell
perl -MCPAN -e shell install Finance::Bitcoin
For more information on module installation, please visit the detailed CPAN module installation guide.