import json
import requests
while True:
try:
_json = json.loads(requests.get('https://api.loopring.network/api/v3/luckyToken/user/luckyTokens?limit=20&official=false&statuses=1%2C2&fromId=0', headers={ 'x-api-key': 'your api key here' }).text)
for entry in _json['list']:
_ = requests.post('https://api.loopring.network/api/v3/luckyToken/claimLuckyToken', headers={ 'x-api-key': 'your api key here' }, json= {'claimer': 'your l2 address here', 'hash': entry['hash'], 'referrer': entry['sender']['address'] }) if entry['status'] == 'PENDING' else None
except:
pass
# 9 line bot for new public rps
# Loopring devs, probably good idea to fix this...
# Possible to adapt to discord btw