如何使用比特币地址发送和接收交易。
我正在使用this url。
我只有用于发送和接收的比特币地址。
另外,我没有我的钱包帐户。
我使用了下面的代码。
$to = // Bitcoin address1
$from = // Bitcoin address2
$json_url = "https://blockchain.info/merchant/d15dea6639d24b81e5caefad8aa4b0c6831cdccf1c21f8c234fd568d40e4238d/payment?to=$to&amount=5000&from=$from";
我得到了下面的错误。
"You must provide a recipient address"
谢谢大家。
发布于 2013-06-29 00:06:22
只需填写下面的信息即可。您需要一个BlockChain帐户才能发送付款。然而,你不需要帐户就能收到。这只是发送,不是回调。如果您正在寻找回调,请进一步阅读文档。
https://blockchain.info/merchant/$guid/payment?password=$main_password&second_password=$second_password&to=$address&amount=$amount&from=$from&shared=$shared&fee=$fee¬e=$note
<?php
$guid="GUID_HERE";
$firstpassword="PASSWORD_HERE";
$secondpassword="PASSWORD_HERE";
$amounta = "10000000";
$amountb = "400000";
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq";
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy";
$recipients = urlencode(json_encode(
array(
$addressa => $amounta,
$addressb => $amountb
)
));
$json_url = "https://blockchain.info/merchant/$guid/sendmany?password=$firstpassword&second_password=$secondpassword&recipients=$recipients";
$json_data = file_get_contents($json_url);
$json_feed = json_decode($json_data);
$message = $json_feed->message;
$txid = $json_feed->tx_hash;
?>
发布于 2014-05-08 05:41:05
您需要在blockchain.info上使用"My wallet API“发送/接收资金:https://blockchain.info/api/blockchain_wallet_api
如果您要使用这个API,我有一个用于与我的区块链钱包交互的PHP类:https://github.com/lukesims/Blockchain-API-PHP-Class,您可能会发现它很有用。
如果你只是想收到付款,那么使用“接收付款API”,这是不同的。我发布的链接不能超过2个,但区块链开发者部分对这两个链接进行了非常明显的区分。
https://stackoverflow.com/questions/16189139
复制相似问题