Skip to content

Instantly share code, notes, and snippets.

@simform-solutions
Created September 20, 2017 07:02
Show Gist options
  • Save simform-solutions/d37a38f4b1bdfca58b103e4530fa77c8 to your computer and use it in GitHub Desktop.
Save simform-solutions/d37a38f4b1bdfca58b103e4530fa77c8 to your computer and use it in GitHub Desktop.
# Displays all addresses with balance, the total account balance and a deposit address.
# In case that there are no saved addresses it will ask if the account should be scanned for balance
# If the User answers with no, then it will just generate a deposit address (at index 0)
def standard_account_info():
address_count = len(address_data)
update_addresses_balance(fal_balance[0]["f_index"])
update_fal_balance()
if address_count < 1:
find_balance(10)
standard_account_info()
elif address_count > 0:
all_address_data = ""
total_balance = 0
for p in address_data:
balance = p["balance"]
address = p["address"]
checksum = p["checksum"]
integrity = verify_checksum(checksum, address)
if balance > 0 and integrity:
total_balance += balance
data = "Index: " + str(p["index"]) + " " + address + " balance: " + convert_units(balance) + "\n"
all_address_data += data
elif not integrity:
total_balance += balance
data = "Index: " + str(p["index"]) + " Invalid Checksum!!!" + "\n"
all_address_data += data
if total_balance > 0:
print(all_address_data)
print("\n" + "Deposit address: " + str(get_deposit_address()))
print("\nTotal Balance: " + convert_units(total_balance))
else:
print("No addresses with balance!")
print("\n" + "Deposit address: " + str(get_deposit_address()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment