Created
September 19, 2018 19:04
-
-
Save uneasyguy/6130781860d28da48969dcfc8a83aeb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from binance.client import Client | |
from datetime import datetime | |
api_key = 'xxxx' | |
api_secret = 'xxxx' | |
binance_account_info = Client(api_key,api_secret) | |
deposits_query = binance_account_info.get_deposit_history() | |
deposits_list = deposits_query['depositList'] | |
for x in range(0,len(deposits_list)): | |
unix_timestamp = float(deposits_list[x]['insertTime'])/1000 | |
timestamp = datetime.utcfromtimestamp(unix_timestamp).strftime('%Y-%m-%d %H:%M:%S.%f') | |
amount = deposits_list[x]['amount'] | |
address = deposits_list[x]['address'] | |
transaction_id = deposits_list[x]['txId'] | |
asset = deposits_list[x]['asset'] | |
status = deposits_list[x]['status'] | |
if status == 1: | |
print ('Your deposit of {} {} at {} to address {} is complete (Transaction ID: {}).'.format(str(amount),str(asset),str(timestamp),str(address),str(transaction_id))) | |
elif status == 0: | |
print ('Your deposit of {} {} at {} to address {} is pending (Transaction ID: {}).'.format(str(amount),str(asset),str(timestamp),str(address),str(transaction_id))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment