以比特币发送和接收交易

问题描述 投票:0回答:2

如何使用比特币地址发送和接收交易。
我正在使用这个网址
我只有用于发送和接收的比特币地址。
而且我没有“我的钱包”帐户。

我使用了下面的代码。

$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"

谢谢大家。

php bitcoin
2个回答
0
投票

您需要在 Blockchain.info 上有一个钱包,才能使用“我的钱包 API”发送/接收资金:https://blockchain.info/api/blockchain_wallet_api

如果您要使用此 API,我有一个 PHP 类,用于与我的区块链钱包交互:https://github.com/lukesims/Blockchain-API-PHP-Class您可能会发现它很有用。

如果您只想接收付款,请使用不同的“接收付款 API”。我不能发布超过 2 个链接,但区块链开发人员部分对两者进行了非常明显的区分。


-1
投票

只需填写以下信息...您需要一个区块链账户才能发送付款。不过,您不需要帐户即可接收。这只是发送,而不是回调。如果您正在寻找回调,请进一步阅读文档。

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;

?>
© www.soinside.com 2019 - 2024. All rights reserved.