WebService::Coinbase - Coinbase (http://coinbase.com) API bindings
version 0.0200
use WebService::Coinbase; my $coin = WebService::Coinbase->new( api_key => 'API_KEY', api_secret => 'API_SECRET', logger => Log::Tiny->new('/tmp/coin.log'), # optional ); my $accounts = $coin->get_accounts();
get_accounts()
Returns the user's active accounts.
get_account($account_id)
Returns one of the user's active accounts.
get_primary_account()
Returns the user's primary account.
set_primary_account($account_id)
Sets the primary account.
create_account($data)
Creates a new account for the user.
Example:
my $account = $coin->create_account({ name => "Bling Bling" });
get_balance()
Returns the user's current balance.
get_account_balance($account_id)
Returns the current balance for the given account.
get_account_address($account_id)
Returns the user's current bitcoin receive address.
create_account_address($account_id, $data)
Generates a new bitcoin receive address for the user.
$coin->create_account_address($account_id, { label => 'college fund', callback_url => 'http://foo.com/bar', });
modify_account($account_id, $data)
Modifies an account.
$coin->modify_account($acct_id, { name => "Kanye's Account" });
delete_account($account_id)
Deletes an account. Only non-primary accounts with zero balance can be deleted.
get_addresses()
Returns the bitcoin addresses a user has associated with their account.
get_address($id_or_address)
Returns the bitcoin address object for the given id or address.
get_contacts()
Returns contacts the user has previously sent to or received from.
get_transactions()
Returns the user's transactions sorted by created_at in descending order.
get_transaction($transaction_id)
Returns the transaction for the given id.
send_money($data)
Send money to an email or bitcoin address.
$coin->send_money({ to => $email_or_bitcoin_address, amount => '1.23', notes => 'Here is your money', });
transfer_money($data)
Transfer bitcoin between accounts.
request_money($data)
Request money from an email.
resend_request($transaction_id)
Resend a money request.
complete_request($transaction_id)
Lets the recipient of a money request complete the request by sending money to the user who requested the money. This can only be completed by the user to whom the request was made, not the user who sent the request.
cancel_request($transaction_id)
Cancel a money request.
get_buy_price() get_buy_price(query => { qty => 1 })
get_sell_price() get_sell_price(query => { qty => 1 })
get_spot_price() get_spot_price(query => { currency => 'CAD' })
get_orders()
Returns a merchant's orders that they have received.
create_order($data)
Returns an order for a new button.
$coin->create_order({ name => 'test', price_string => '1.23', price_currency_iso => 'BTC', });
get_order($order_id)
Returns order details.
refund_order($order_id, $data)
Refunds an order.
$coin->refund_order($order_id, { refund_iso_code => 'BTC' })
Naveed Massjouni <naveed@vt.edu>
This software is copyright (c) 2015 by Naveed Massjouni.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WebService::Coinbase, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Coinbase
CPAN shell
perl -MCPAN -e shell install WebService::Coinbase
For more information on module installation, please visit the detailed CPAN module installation guide.