Bitcoin transaction You must provide a recipient address error

0 votes

I have written a code to send and receive transaction using bitcoin address. I have only Bitcoin addresses for send and receive. Also I do not have a My Wallet account.

$to = // Bitcoin address1

$from = // Bitcoin address2

$json_url = "https://blockchain.info/merchant/d15dea6639d24b81e5caefad8aa4b0c6831cdccf1c21f8c234fd568d40e4238d/payment?to=$to&amount=5000&from=$from";

I got below error.

"You must provide a recipient address"
Aug 20, 2018 in Blockchain by slayer
• 29,370 points
712 views

1 answer to this question.

0 votes

You need an account with BlockChain to send payments. You don't need an account to receive.

I use the following code and it works:


<?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;


?>

To know more, visit: https://www.blockchain.com/api/blockchain_wallet_api

answered Aug 20, 2018 by digger
• 26,740 points

Related Questions In Blockchain

0 votes
1 answer

Truffle tutorials "Error:recipient address is not a contract address"

It appears like you have already migrated ...READ MORE

answered Aug 8, 2018 in Blockchain by slayer
• 29,370 points
1,136 views
0 votes
1 answer
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,928 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,740 points
45,227 views
0 votes
1 answer

How do I add multiple recipients for transactions via Blockchain API?

Convert the recipes into JSON objects. x = ...READ MORE

answered Jul 6, 2018 in Blockchain by Perry
• 17,100 points
891 views
0 votes
1 answer

Solidity mocha : address is not a contract error

Try the following: // Initialize contract variable with ...READ MORE

answered Oct 1, 2018 in Blockchain by digger
• 26,740 points
1,070 views
0 votes
1 answer

How to extract h160 address of bitcoin blockchain?

You can extract the data using the ...READ MORE

answered Jul 16, 2018 in Blockchain by digger
• 26,740 points
2,558 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP