简体   繁体   English

使用多个收件人通过Blockchain API进行交易

[英]Transaction via Blockchain API using Multiple recipients

Im trying to send bitcoins using Blockchain.info API to both adresses in 'recipes': 我试图使用Blockchain.info API将比特币发送给“配方”中的两个地址:

recipes ={'1Pd9gXJ8EqyGrqMKVevQWNjjF4B4dcSykf':10000,'14gVMjoCbjaGU3s9EQghVxYTAJgkmqqtHV':10000}

My request looks like: 我的要求如下:

url_multi = 'https://blockchain.info/nl/merchant/MYKEY/sendmany?password=MYPASSWORD&recipients='+recipes+'&fee=15000'

requests.get(url_multi)

I managed to send txs to single adresses using the examples in the documentation . 我设法使用文档中的示例将tx发送给单个地址。 However, sending to multiple adresses at once requires a dict according to the PHP-example. 但是,根据PHP示例,一次发送到多个地址需要一个命令。

In Python, the following Typerror gets returned; 在Python中,返回以下Typerror; TypeError: cannot concatenate 'str' and 'dict' objects TypeError:无法连接“ str”和“ dict”对象

How do I add multiple recipients to the request without using a dict? 如何不使用字典将多个收件人添加到请求中?

recipes should have been a JSON object instead. 食谱应该是JSON对象。 So I converted it before adding it to the URL. 因此,我在将其添加到URL之前对其进行了转换。 Works fine now. 现在工作正常。

x = json.dumps(recipes) 

url_multi = 'https://blockchain.info/nl/merchant/MYKEY/sendmany?password=MYPASSWORD&recipients='+x+'&fee=15000'

requests.get(url_multi)

I suck sometimes ;( 有时我吮吸;(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在python中使用google api添加多个收件人? - Adding multiple recipients using google api in python? 使用 SparkPost API 将单独的电子邮件发送给多个收件人,而无需使用密件抄送 - Send individual emails to multiple recipients without using BCC with the SparkPost API 通过 Web3 从以太坊区块链获取交易 - Get transaction from ethereum blockchain via Web3 Python - 使用smtplib发送给多个收件人 - Python - using smtplib to send to multiple recipients 使用 Python 发送给 Outlook 中的多个密件抄送收件人 - Using Python to send to multiple BCC recipients in Outlook 通过SurveyMonkey API获取电子邮件收集器中用于调查的所有收件人的列表 - Getting list of all recipients in an email collector for a survey via SurveyMonkey API 通过api检查我的blockchain.info钱包的历史记录 - check history of my blockchain.info wallet via api 通过apiblockchain.info检查以太坊钱包 - check ethereum wallet on via api blockchain.info 如何在Blockchain上存储事务日志? - How to store transaction Logs on Blockchain? Mandrill API 与收件人(cc)一起发送 email,但它也使用 Django==1.11.10 将邮件作为“TO”发送给收件人(cc) - Mandrill API to send email with recipients(cc), but It also send mail to recipients(cc) as 'TO' using Django==1.11.10
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM