Catalyst::Model::Bitcoin - Catalyst model class that interfaces with Bitcoin Server via JSON RPC
Use the helper to add a Bitcoin model to your application:
./script/myapp_create.pl model BitcoinServer Bitcoin
After new model created, edit config:
# ./lib/MyApp/Model/BitcoinServer.pm __PACKAGE__->config( uri => 'http://rpcuser:rpcpassword@localhost:8332', );
In controller:
# Get address object (see Finance::Bitcoin::Address) my $address = $c->model('BitcoinServer')->find($address_string); # Send coins to address. $c->model('BitcoinServer')->send_to_address($address_string, $amount); # Generate new address to receive coins. my $new_address_string = $c->model('BitcoinServer')->get_new_address(); # Get current wallet balance. my $balance = $c->model('BitcoinServer')->get_balance();
This model class uses Finance::Bitcoin to access Bitcoin Server via JSON RPC.
https://github.com/hippich/Catalyst--Model--Bitcoin, https://www.bitcoin.org, Finance::Bitcoin, Catalyst
Pavel Karoukin <pavel@yepcorp.com> http://www.yepcorp.com
Copyright (C) 2010 by Pavel Karoukin
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
To install Catalyst::Model::Bitcoin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Model::Bitcoin
CPAN shell
perl -MCPAN -e shell install Catalyst::Model::Bitcoin
For more information on module installation, please visit the detailed CPAN module installation guide.