-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
btcstealer_api.py
64 lines (48 loc) · 1.4 KB
/
btcstealer_api.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import sys
import re
from time import sleep
from bitcoin import *
try: # if is python3
from urllib.request import urlopen
except: # if is python2
from urllib2 import urlopen
from fastapi import FastAPI, Depends
import random
from datetime import datetime
import json
import requests
s = requests.Session()
app = FastAPI()
times = datetime.now()
dt_string = times.strftime("%d/%m/%Y %H:%M:%S")
zero = "[{}]"
class status():
status: str
with open("status.json", "r") as f:
current_status = json.load(f)['status']
@app.get('/beta/status')
def get_status():
with open("status.json", "r") as f:
current_status = json.load(f)['status']
status = current_status
return status
@app.get("/version/{version}")
def version(version : int):
curr_version = 2
if curr_version > version:
return("Check for Updates!")
else:
return("Lastest Version Installed!")
@app.get('/beta/check/{address}')
def check_balance(address: str):
try:
wallet = s.get(f"https://api-r.bitcoinchain.com/v1/address/{address}", stream = True)
response = wallet.json()
if zero in response:
return(0)
else:
return(response)
except:
return("Could not Request Server!")
with open('logs.txt', 'a') as the_file:
the_file.write(f'{response}\n')