rency.
This module provides high and low level APIs for managing a running
bitcoin instance over JSON-RPC.
=head1 BUGS
Please report any bugs to L<http://rt.cpan.org/>.
=head1 SEE ALSO
L<Finance:
tcoin instance.
=over 4
=item C<< new($endpoint, $string) >>
Constructor. $endpoint may be the JSON RPC endpoint URL, or may be a
Finance::Bitcoin::API object; $string is an address string.
=begin
;
}
sub addresses
{
my ($self) = @_;
my $list = $self->api->call('listreceivedbyaddress', 0, JSON::true);
return unless ref($list) eq 'ARRAY';
return
map { "Finance::Bitcoin::Address"->new
unning
Bitcoin instance.
=over 4
=item C<< new($endpoint) >>
Constructor. $endpoint may be the JSON RPC endpoint URL, or may be a
Finance::Bitcoin::API object.
=begin trustme
=item BUILDARGS
=en
use JSON::RPC::Legacy::Client;
use Scalar::Util qw( blessed );
has endpoint => (is => "rw", default => sub { "http://127.0.0.1:8332/" });
has jsonrpc => (is => "lazy", default => sub { "JSON::RPC
y $self = shift;
my ($method, @params) = @_;
$self->_set_error(undef);
my $return = $self->jsonrpc->call($self->endpoint, {
method => $method,
params => \@params,
});
if (blessed
lf->_set_error(sprintf('HTTP %s', $self->jsonrpc->status_line));
return;
}
}
1;
__END__
=head1 NAME
Finance::Bitcoin::API - wrapper for the Bitcoin JSON-RPC API
=head1 SYNOPSIS
use Finance::