How to transfer SBD or STEEM to multiple accounts? (Batch transfer with steem-python) / 如何向多个账户批量转账

in steemdev •  7 years ago 

Manual transfer

Some of my friends held some very interesting activities on steemit. Such as 谷哥点名 by @jubi, and 七夕征文大赛by @rivalhw. The activities are very successful, plenty of people did participate and many people won the prize.

But, How to pay bonuses is a bit of a hassle, organizers need to log on to the website and transfer bonuses to each winner.

If there are a large number of winners, We need to do the same thing over and over again.

Batch transfer

Fortunately, we can implement batch transfers using program.
Just installed the official python library for STEEM as I mentioned in my previous article

But, We need Active private key this time, follow the same steps in my previous article but select Active private key, and then import it to our local wallet.

A simplest script maybe like this:

#!/usr/bin/env python
import sys
from steem import Steem

from_account = 'oflyhigh'
to_accounts = ['oflyhigh.test', 'jubi', 'deanliu']
amount = 0.001
asset = 'SBD'
message = 'Test transfer!'

def main(argv=None):
        steem=Steem()
        for to_account in to_accounts:
                steem.transfer(to_account, amount=amount, asset=asset, memo=message, account=from_account)

if __name__ == "__main__":
        sys.exit(main())

Now, we can transfer 0.001 SBD to multiple accounts ( @oflyhigh.test, @jubi, @deanliu) by executing the script. A message Test transfer! was added at the same time.

Now, let me check my wallet:

We made it successfully!

For encrypted messaging

steem-python also supports message encryption.

To issue a encrypted message, just plus # prefix for your message.
For example,
message = '#Test transfer!'

And you must import memo private key to your local wallet, otherwise you will get the following error message like this one:
steembase.exceptions.MissingKeyError: Memo key for oflyhigh missing!

There's a small issue of steem-python for encrypted memo

We get two '#' in the memo, which should be one, but it doesn't matter.

中文

我的一些朋友在STEEMIT举办了很多有意思的活动,比如 @jubi谷哥点名@rivalhw七夕征文大赛等等。这些活动非常成功,吸引了很多朋友参加并且很多朋友赢得了奖励。

但是,如何发放奖励是很麻烦的事情,组织者要登陆网站给每个获奖者一笔一笔的转账。如果获奖者很多,那么我们就要一次又一次的做相同的事情。

幸运的是,我们可以用程序实现批量转账并附加备注信息,代码参见英文部分。

程序同时支持备注消息加密,在消息前边加个#号就可以了。但是steem-python有点小BUG,转账后的消息里多了一个#号,但是这没啥大影响。

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
  ·  7 years ago (edited)

If you'd like it to be super fast and efficient, you can pack multiple op's in a single tx.
http://steem.readthedocs.io/en/latest/examples.html#batching-operations

guide me also

Thank you for your comment.

I had already introduced Batching Operations in my another article:
https://steemit.com/cn/@oflyhigh/operation-transaction
This method is really efficient, but it may be too technical to explain😀

BTW: I'm very glad that you brought SteemData SBDS back, It's really very useful. 👍

Thanks. I check this.

Is there perhaps a website/tool for this? I don't understand this whole python stuff

It seems as easy as pie....thanks for your tips....now i know more...

It would be great a web interface is developed so that non-coder people can send STEEM or SBD to multiple people. Thanks for the efforts though.

awesome

Good information. i resteem your post.

thanks for the info.. really helpful

Something many people should

helpfull, only i have registered sucsesfully multiple account

As a newbie gain much knowledge, nice sharing!

Very handy, nothing worse then fill the same form out over and over again.

Thanks for sharing!

  ·  7 years ago 

o哥测试转账的时候欢迎加上我。。。

下次统统加上

  ·  7 years ago (edited)

好,期待下次,明天吧。

Nice informatinformativepost

thank you so much for the info

  ·  7 years ago 

下次可以轉錢給我來做示範^^

哈哈哈 +1

thanks for the info

Nice

太酷了!非常方便,但是,具体这个操作,感觉对非技术人士还是有些难度了

  ·  7 years ago (edited)

其实很简单的
普通用户, 弄个Linux系统(或许虚拟机),一步一步操作就可以了

Linux is FUD

要如何轉大量資金到另一個帳戶呢?快點!使用我當例子!等你喔!

刘老师不介意我分一些吧 哈哈

排隊。。。

5%

我排這裡!! XD ((還排得到嗎?))

1%

有排到就好~~

是要分给我们每人1%吗?我第一个排队领哦

偉哥你都信用70了還跟著小朋友們信這些啊?0乘以多少都是0啊~~~~ 啊哈哈哈~~~~

10%

你确定用你当例子?我这就去把你的钱都转移到我账户下。

你要做你能力做得到的嘛!轉我錢走,你去試試啊!

😭

@oflyhigh very interesting ..love your post...i'm your supporter and follower,.kindly see my post and upvote it..your vote is a big help on small timer like me..hope you upvote my post..thanks for your humble heart..support..thank you ..my friend

https://steemit.com/christianity/@mrblu/blessed-by-thy-name-of-the-lord

https://steemit.com/poetry/@mrblu/poem-the-power-of-deception-faces

https://steemit.com/poetry/@mrblu/poem-i-m-tired

https://steemit.com/poetry/@mrblu/poem-the-power-of-deception-faces

我是不是来晚了

I have understood now....

Please follow me back @hanisullah

its helpful buddy these tips are very easy to use i appreciate your work

very useful information, pretty simple and clear. 写得很清楚,而且看起来很简单, 点赞了。有空的话看看我的最新post吧,谢谢你了 点这里哦 :)

Very informative

I have learnt a lot from this article.
Thank you!
And keep it on

赞,这个方法节省了不少时间。

@oflyhigh, This is something much needed and I'm glad I found it here. A lot of people are going to like this post and I'm sure I'm the first one to resteem it. You got my upvote as well. Keep posting.

Good post..
May sometimes you might to send me a present to show your kindness 😄😉

Thank you for the info @oflyhigh

Very nice sharing with good necessary informations.

所以你是修改了程序是吗?安全性不会改变吧?

Thanks. I try this .

Wow really helpful 😊👍🏼🍂💯👏🏼🎶

I will try this soon, I run giveaways and I had to stop just because it takes a lot of time to send the rewards to hundreds of people.

I still have to send about 7 SBD to more than 100 people and I will try your program and hopefully it will work.

Thanks in advance.

test 20170907

感谢O哥分享!

I wish... Some one can just do a 0.1 transfer to me... My account thinks I am probably dead.... Tears

Didn't know this was possible. Thanks for informing us about the multiple account transfer

Congratulations @oflyhigh!
Your post was mentioned in the hit parade in the following category:

  • Pending payout - Ranked 6 with $ 306,93

感觉编程的都是魔术师,写个代码,什么都能实现!

Thanks for sharing

Pls sbd 1 pls

Excellent and timely. I resteemed your post.

I really don't know anything about esteem. How can I raise the income and have more followers ?
I uploaded only one article and got from it 0.0

thanks for the info oflyhigh
upvoted and followed you, please do the same

Good share 👍🏻 !

thanks you help me :)

Good to know, tanks buddy.

Well written and informative. Thank you for posting this. Steem On! :)

This is useful

I am new to steemit, your post is very informative and helpful i have upvoted you and follow you as well, so as not to miss any of your new post.

Really informative post !
Thanks for sharing .