I've been having a horrible time attempting to connect to blockchain.info using the JSON RPC API.
Here's what I have for testing code
<?php
require_once('classes/jsonRPCClient.php');
$address = "BITCOIN_ADDRESS";
$bitcoin = new jsonRPCClient('http://USER_Identifier:PASSWORD@rpc.blockchain.info:80/');
echo "<pre>\n";
print_r($bitcoin->getinfo()); echo "\n";
print_r($bitcoin->getaccount($address)); echo "\n";
$account = $bitcoin->getaccount($address);
print_r($bitcoin->getaccountaddress($account)); echo "\n";
echo "Received: ".number_format($bitcoin->getbalance($account), 7) . " BTC\n";
echo "Received: ".number_format($bitcoin->getbalance($address), 7) . " BTC\n";
echo "</pre>";
?>
And here is the response I get back
Array
(
[balance] => 0
[errors] =>
[paytxfee] => 0
[proxy] =>
[connected] => 1176
[testnet] =>
[difficulty] => 10076292.883419
[blocks] => 235379
)
TEST_LABLE
BITCOIN ADDRESS OF THE MAIN ACCOUNT
Received: 0.0000000 BTC
Received: 0.0000000 BTC
There's currently around 0.0000754 coins in the account so I'm not sure why it's returning 0. It seems like I can't access anything to do with my account aside from finding out what label is associated with a given bitcoin address. Am I missing something?