Post
Topic
Board Altcoin Discussion
Re: Alerts on large token balance holder accounts
by
Kallisteiros
on 22/07/2018, 12:58:24 UTC
Thank you!

Do you think those plug-ins would be difficult to set up? or require a lot of maintenance? I have 0 coding experience so that's a bit of an issue lol!
That's why I hope everyone in the future learns to code, and the whole world is APIzed. Then you would immediately see how easy it is to make a 10 line custom script hooking up to an Etherscan API and fetching any information you want.

Code:
import urllib, json, time, sys
  
url = "https://api.etherscan.io/api?module=logs&action=getLogs&fromBlock=6000000&toBlock=latest&address=0xd26114cd6EE289AccF82350c8d8487fedB8A0C07&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef&apikey=YourApiKeyToken"

while True:
    data = json.loads(urllib.urlopen(url).read())
    for tx in data['result']:
        moved = int(tx['data'], 16) / 1e18
        if moved > 1000000:
            print("Moved " + str(moved) + " OMG, transaction hash = "+tx['transactionHash']) # you can e.g. send email from here
            sys.exit()
    time.sleep(30)