WalletBit/API/Getnewaddress: Difference between revisions
Jump to navigation
Jump to search
Blanked the page |
Add disclaimer |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
The following information may no longer be true, WalletBit service was suspended | |||
See https://bitcointalk.org/index.php?topic=249751.new | |||
The article is kept only as historic documentation. | |||
===Generate new Bitcoin address=== | |||
<source lang="php"> | |||
$fields = array( | |||
'merchant' => 'owner@example.com', | |||
'label' => 'TEST' | |||
); | |||
$fields['encrypted'] = strtoupper(hash('sha256', $fields['merchant'] . ':' . $fields['label'] . ':' . 'API Key')); | |||
$ch = curl_init(); | |||
curl_setopt($ch, CURLOPT_URL, 'https://walletbit.com/api/getnewaddress'); | |||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE); | |||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, TRUE); | |||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); | |||
curl_setopt($ch, CURLOPT_POST, count($fields)); | |||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields)); | |||
$response = curl_exec($ch); | |||
curl_close($ch); | |||
</source> | |||
If successful $response will contain your new bitcoin address, otherwise empty. |
Latest revision as of 15:59, 6 April 2014
The following information may no longer be true, WalletBit service was suspended See https://bitcointalk.org/index.php?topic=249751.new The article is kept only as historic documentation.
Generate new Bitcoin address
$fields = array(
'merchant' => 'owner@example.com',
'label' => 'TEST'
);
$fields['encrypted'] = strtoupper(hash('sha256', $fields['merchant'] . ':' . $fields['label'] . ':' . 'API Key'));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://walletbit.com/api/getnewaddress');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($fields));
$response = curl_exec($ch);
curl_close($ch);
If successful $response will contain your new bitcoin address, otherwise empty.