Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This should print out how many USDT have been printed
#########################################################
# This should print out how many USDT have been printed #
# date created: 22/08/2018 #
# date updated: 22/08/2018 #
#########################################################
import requests
import os
import json
import tempfile
import arrow
from pprint import pprint
tmp = tempfile.gettempdir()
# get a page from omniexplorer, with local caching
# to avoid running into rate limiting
def get_page(page):
fn = os.path.join(tmp, str(page))
if os.path.exists(fn):
with open(fn, 'r') as f:
return json.load(f)
data = {'addr':'3MbYQMMmSkC3AgWkj9FMo5LsPTW1zBTwXL', 'page': '%s'%page}
r = requests.post("https://api.omniexplorer.info/v1/transaction/address", data=data)
j = r.json()
with open(fn, 'w') as f:
json.dump(j, f)
return j
def main():
i = 0
transactions = []
# query pages, and aggregate transactions
while True:
page = get_page(i)
transactions.extend(page['transactions'])
if page['pages'] == i+1:
break
i += 1
total = 0
# accumulate printed amounts
for t in reversed(transactions):
if t['type'] == 'Grant Property Tokens':
total += float(t['amount'])
print('tether printed {0} on {1}'.format(t['amount'], arrow.get(t['blocktime']).humanize()))
# output results
print("-"*50)
print("total tokens created: {:,} USDT".format(total))
if __name__ == "__main__":
main()
@shyal

This comment has been minimized.

Copy link
Owner Author

@shyal shyal commented Aug 22, 2018

tether printed 100.00000000 on 3 years ago
tether printed 1500.00000000 on 3 years ago
tether printed 50000.00000000 on 3 years ago
tether printed 200000.00000000 on 3 years ago
tether printed 200000.00000000 on 3 years ago
tether printed 50.00000000 on 3 years ago
tether printed 500000.00000000 on 2 years ago
tether printed 500000.00000000 on 2 years ago
tether printed 500000.00000000 on 2 years ago
tether printed 1000000.00000000 on 2 years ago
tether printed 1000000.00000000 on 2 years ago
tether printed 2000000.00000000 on 2 years ago
tether printed 1000000.00000000 on 2 years ago
tether printed 1365.54000000 on 2 years ago
tether printed 3000000.00000000 on 2 years ago
tether printed 5000000.00000000 on 2 years ago
tether printed 10000000.00000000 on 2 years ago
tether printed 10000000.00000000 on a year ago
tether printed 10000000.00000000 on a year ago
tether printed 10000000.00000000 on a year ago
tether printed 195.00000000 on a year ago
tether printed 10000000.00000000 on a year ago
tether printed 10000000.00000000 on a year ago
tether printed 10000000.00000000 on a year ago
tether printed 10000000.00000000 on a year ago
tether printed 10000000.00000000 on a year ago
tether printed 10000000.00000000 on a year ago
tether printed 10000000.00000000 on a year ago
tether printed 20000000.00000000 on a year ago
tether printed 20000000.00000000 on a year ago
tether printed 20000000.00000000 on a year ago
tether printed 30000000.00000000 on a year ago
tether printed 30000000.00000000 on a year ago
tether printed 30000000.00000000 on a year ago
tether printed 25000000.00000000 on a year ago
tether printed 25000000.00000000 on a year ago
tether printed 20000000.00000000 on a year ago
tether printed 25000000.00000000 on a year ago
tether printed 25000000.00000000 on a year ago
tether printed 25000000.00000000 on a year ago
tether printed 25000000.00000000 on 11 months ago
tether printed 25000000.00000000 on 10 months ago
tether printed 25048400.00000000 on 9 months ago
tether printed 20000000.00000000 on 9 months ago
tether printed 20000000.00000000 on 9 months ago
tether printed 30000000.00000000 on 9 months ago
tether printed 30000000.00000000 on 9 months ago
tether printed 20000000.00000000 on 9 months ago
tether printed 30000000.00000000 on 9 months ago
tether printed 30000000.00000000 on 9 months ago
tether printed 1000.00000000 on 9 months ago
tether printed 10000000.00000000 on 9 months ago
tether printed 10000000.00000000 on 9 months ago
tether printed 10000000.00000000 on 9 months ago
tether printed 20000000.00000000 on 9 months ago
tether printed 14999000.00000000 on 9 months ago
tether printed 20000000.00000000 on 9 months ago
tether printed 25000000.00000000 on 9 months ago
tether printed 24999000.00000000 on 9 months ago
tether printed 25000000.00000000 on 8 months ago
tether printed 25000000.00000000 on 8 months ago
tether printed 25000000.00000000 on 8 months ago
tether printed 25000000.00000000 on 8 months ago
tether printed 25000000.00000000 on 8 months ago
tether printed 25000000.00000000 on 8 months ago
tether printed 25000000.00000000 on 8 months ago
tether printed 25000000.00000000 on 8 months ago
tether printed 55000000.00000000 on 8 months ago
tether printed 50000000.00000000 on 8 months ago
tether printed 50000000.00000000 on 8 months ago
tether printed 50000000.00000000 on 8 months ago
tether printed 50000000.00000000 on 8 months ago
tether printed 50000000.00000000 on 8 months ago
tether printed 100000000.00000000 on 8 months ago
tether printed 100000000.00000000 on 7 months ago
tether printed 50000000.00000000 on 7 months ago
tether printed 100000000.00000000 on 7 months ago
tether printed 100000000.00000000 on 7 months ago
tether printed 100000000.00000000 on 7 months ago
tether printed 100000000.00000000 on 7 months ago
tether printed 100000000.00000000 on 7 months ago
tether printed 100000000.00000000 on 7 months ago
tether printed 100000000.00000000 on 7 months ago
tether printed 300000000.00000000 on 5 months ago
tether printed 250000000.00000000 on 3 months ago
tether printed 250000000.00000000 on 2 months ago
tether printed 300000000.00000000 on 5 months ago
tether printed 250000000.00000000 on 3 months ago
tether printed 250000000.00000000 on 2 months ago
--------------------------------------------------
total tokens created: 3,865,000,610.54 USDT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.