在之前的文章中:
我提及了一个大家或许不知道的功能PowerDown Route,通过这一功能,你可以把一个账户里的SP提现到另外一个账户,也可以选择提现的时候PowerUp到另外一个账户。
当时为了理解这个事,特意拿个测试账户测试了一下,设置测试号A的PowerDown Route为B, 然后我今天突然想看一下我设置的B是哪个账户,结果尴尬了,在steemd.com 找不到。
steemd.com上只有这个信息:
如果你从未设置过,那么应该是:
好吧,我知道我设置过,但是我设置哪里去了呢?
API get_withdraw_routes
研究半天发现有一个API
vector< withdraw_route > get_withdraw_routes( string account, withdraw_route_type type = outgoing )const;
相关结构体和类型定义:
struct withdraw_route
{
string from_account;
string to_account;
uint16_t percent;
bool auto_vest;
};
enum withdraw_route_type
{
incoming,
outgoing,
all
};
curl 测试
有了上述API定义,我们就可以使用curl进行调用了
查询account_a的PowerDown Routes
curl --data '{"jsonrpc": "2.0", "method": "get_withdraw_routes", "params": ["account_a", 1], "id": 1}' https://steemd.steemit.com
得出如下结果:
{"id":1,"result":[{"from_account":"account_a","to_account":"account_b","percent":10000,"auto_vest":false}]}
查询将account_a设置为PowerDown Route的账户列表
curl --data '{"jsonrpc": "2.0", "method": "get_withdraw_routes", "params": ["account_a", 0], "id": 1}' https://steemd.steemit.com
查询结果为空:
{"id":1,"result":[]}
steem python 库
直接使用API可以查询账户的PowerDown Route(Incoming, outgoing)
当然也可以自行对API就行封装
庆幸的是, steem python 库已经帮我们做好了封装
get_withdraw_routes
def get_withdraw_routes(self, account: str, withdraw_route_type: str):
""" get_withdraw_routes """
return self.exec('get_withdraw_routes', account, withdraw_route_type, api='database_api')
简单的测试代码
from steem import Steem
from pprint import pprint
steem = Steem()
routes = steem.get_withdraw_routes('account_a', 'all')
pprint(routes)
结果
[{'auto_vest': False,
'from_account': 'account_a',
'percent': 10000,
'to_account': 'account_b'}]
设置& 取消PowerDown Route
设置
可以使用steem python 库提供的API设置PowerDown Route
set_withdraw_vesting_route
详情见代码内注释即可
可以设置N个Routes,并对其分配不同比例,总量不超过100%
取消
如果想取消对account_a设置的PowerDown Route
只需将account_a的PowerDown Route 设置为account_b,并将percent设置为0 即可
说明: 文中 account_a, account_b 仅为说明问题,非实际账户。
#steemdev is a good tag for posts like these.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you,I will use this tag in the next steem development related posts.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Ran it through google translator. Interesting - thanks.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Lol wish i could read this post.... i likes the pics though lol3)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
長知識了,真的不知道有power down route 這個東西呢~
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
BITCOIN VOLUME BUY PATTERN
🐒 Now for a completely different Sell pattern it works like this I have circled two volume highs and the btc price also made intermediate highs then as well .Now I'm thinking that if Bitcoin runs up again in price in new highs I should be watching the volume on this chart and if the volume makes a high above the last high of400,398 I will be selling some of my Bitcoin
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
可以把sp转移到另外一个id 感觉好像代理 嘿嘿
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
和代理有所区别
这个是真转移
代理是借,可以随时收回
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
哥 先代理个一个亿 哈哈
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
已代理,请查收
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
白借的吧?不用利息?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
可以多代理一個億到我這裏嗎? :p
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great post
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Even though it took me some time to interpret it, but i found it interesting
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi @oflyhigh
Thank you for shared.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I like your posts even though I do not fully understand but thank goodness because I can still use translate application to be able to read your writing. I have a suggestion so that your writing can be in two languages that is your own country language and english because your writing is already worldwide, sorry this is just a suggestion from a reader like me.
Best regards from me
@mukhtar.juned
steamians from Aceh Indonesia
#indonesia
#ksi
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I like this post, very nice and good post. @naz722
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks to google. I think I got the idea. Thank you.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
总结的很不错 :)
upvoted, followed
如果有时间的话帮我点个赞呗👍👍
Please get your time and like my page
Thanks
https://steemit.com/cn/@applesspatrick/a-short-visit-to-bushan-south-korea
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
你好
你的这篇文章是非常好的/我不懂你的语言,但是使用更改的软件和m阅读你的文章
关于编程的很好的信息
m也是在软件工程师学习的程序员
因为我的回报非常低,这里需要你帮助Steemit Up投票
我希望你了解我的语言和感受
如果你不介意请来我的博客@faheemahmad&@ chillimilli786
都是我的帐号
如果你不介意,请加入https://steemit.chat/home
并搜索我chillimilli786
Thanks For Supporting me
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Very interesting post friend, thank you
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Cant Understand chinise but looks intresting .
Upvoted
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
还真不知道可以power up 到其他帐号呢,不过我对编程这东西完全是一窍不通啊,唉!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
我懂一些编程 但是对于O哥发的,我每次都是一窍不通啊,唉! 我学得一定是假程序。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
会发帖就好啦:)
你的帖子一个字: 值
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Very interesting thanks.
Check out my latest post please.
https://steemit.com/travel/@simonsayz/travel-to-xiamen-with-me-holiday-photo-journal-ed-3
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
好有趣。看來真得學Python. 我惡補一陣後再來請教。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @oflyhigh!
Your post was mentioned in the hit parade in the following category:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
nice post, thanks for sharing.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit