This commit is contained in:
aazhou 2023-06-24 17:27:18 +08:00
parent 255bcb3a25
commit fe3a0f3e07
2 changed files with 12 additions and 11 deletions

View File

@ -6,7 +6,7 @@ import time
import tg
import traceback
import logging
import json
def run():
try:
@ -16,12 +16,13 @@ def run():
url = f'https://api.whale-alert.io/v1/transactions?api_key={settings.whaleAlert_apikey}&start={start_ts}&min_value={settings.whaleAlert_max_limit}'
headers = {'Accept': 'application/json'}
resp = requests.get(url, headers=headers).json()
print(resp)
if resp['result'] == "success":
if 'transactions' in resp:
data = resp['transactions']
resp = requests.get(url, headers=headers).text
data = json.loads(resp)
print(data)
if data['result'] == "success":
if 'transactions' in data:
data = data['transactions']
for ts in data:
if ts['to']['owner_type'] == 'exchange':
@ -38,8 +39,9 @@ def run():
tg.send_message(settings.chat_id, content)
else:
print(resp['message'])
tg.send_message(settings.chat_id, resp['message'])
print(data)
tg.send_message(settings.chat_id, data['message'])
except:
print(resp)
logging.error(traceback.format_exc())
tg.send_message(settings.chat_id, traceback.format_exc())

View File

@ -5,5 +5,4 @@ import datetime as dt
import monitors.large_transfer as lt
from binance.spot import Spot
symbols = bn.symbols()
print(symbols)
lt.run()