-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
44 lines (33 loc) · 1.09 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import requests
from flask import Flask, render_template, request
from web3 import Web3
app = Flask(__name__)
# WTF PASO
def is_human(addres):
api = requests.get("https://api.poh.dev/profiles/" + addres)
api = api.json()
try:
status = api["status"]
is_registered = status == "REGISTERED"
return is_registered
except:
return False
@app.route('/')
def main():
return render_template('app.html')
@app.route('/send', methods=['POST'])
def send(balance=balance):
if request.method == 'POST':
Addres = request.form['addres']
node = "https://mainnet.infura.io/v3/7cad44d68f7e4c5fa5935f78d354e696"
is_human = is_human(Addres)
if is_human == True:
print("Human")
connect = Web3(Web3.HTTPProvider(node))
balance = connect.eth.get_balance(Addres)
balance = connect.fromWei(balance, "ether")
balance = "Your balance is: " + str(balance) + " ETH"
return render_template('app.html', balance=balance)
if __name__ == ' __main__':
app.debug = True
app.run()