want to know how much SBD people has been transfer to your account?
from steem import Steem
from coinmarketcap import Market
################################################################################
##################### update deposit ##########################
################################################################################
def payment_list(acc_name,nodes):
s = Steem(nodes)
ac=steem.account.Account(acc_name,s)
transfers = ac.get_account_history(-1,10000,filter_by=['transfer'])
coinmarketcap = Market()
Steem_market_price_USD= float(coinmarketcap.ticker('steem', convert='USD')[0]['price_usd'])
SBD_market_price_USD= float(coinmarketcap.ticker('steem-dollars', convert='USD')[0]['price_usd'])
payment_list={}
# update transfer record and deposit list
for transfer in transfers:
if(transfer['to']==acc_name):
if(transfer['from'] not in payment_list):
if (transfer['amount'].split()[0]=='STEEM'):
SBD_amount = float(transfer['amount'].split()[0])*Steem_market_price_USD/SBD_market_price_USD
else:
SBD_amount = float(transfer['amount'].split()[0])
payment_list.update({transfer['from']:{'SBD':SBD_amount,
'last_transfer_time':transfer['timestamp']
}
})
else:
payment_list[transfer['from']]['SBD'] = payment_list[transfer['from']]['SBD']+float(transfer['amount'].split()[0])
payment_list[transfer['from']]['last_transfer_time'] = transfer['timestamp']
print(payment_list)
################################################################################
nodes = ['https://api.steemit.com',
'https://steemd.minnowsupportproject.org',
'https://rpc.buildteam.io',
'https://steemd.privex.io',
'https://gtg.steem.house:8090']
payment_list('python-dev',nodes)
Congratulations @python-dev! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
You made your First Comment
You got a First Reply
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard:
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