加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 在比特币中发送和接收交易

发布时间:2020-12-13 22:48:24 所属栏目:PHP教程 来源:网络整理
导读:如何使用比特币地址发送和接收交易. 我正在使用 this url. 我只有比特币地址用于发送和接收. 此外,我没有自己的电子钱包帐户. 我使用下面的代码. $to = // Bitcoin address1$from = // Bitcoin address2$json_url = "https://blockchain.info/merchant/d15de
如何使用比特币地址发送和接收交易.
我正在使用 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"

谢谢大家.

解决方法

只需填写以下信息……您需要一个BlockChain帐户才能发送付款.但是,您无需接收帐户.这只是发送而不是回调.如果您正在寻找回调,请阅读文档.

https://blockchain.info/merchant/ $GUID /支付密码= $main_password和放大器; second_password = $second_password和放大器;要= $地址和放大器;金额= $量放大器;从= $从&安培;共享= $共享和放大器;费用= $fee?e= $笔记

<?php

$guid="GUID_HERE";
$firstpassword="PASSWORD_HERE";
$secondpassword="PASSWORD_HERE";
$amounta = "10000000";
$amountb = "400000";
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq";
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy";
$recipients = urlencode('{
              "'.$addressa.'": '.$amounta.',"'.$addressb.'": '.$amountb.'
           }');

$json_url = "http://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;

?>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读