File size: 1,274 Bytes
7837518
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import requests

from orrnob_drops_automation import base
from core.headers import headers


def get_info(token, proxies=None):
    url = "https://www.binance.com/bapi/growth/v1/friendly/growth-paas/mini-app-activity/third-party/user/user-info"
    payload = {"resourceId": 2056}

    try:
        response = requests.post(
            url=url,
            headers=headers(token=token),
            json=payload,
            proxies=proxies,
            timeout=20,
        )
        data = response.json()
        total_grade = data["data"]["metaInfo"]["totalGrade"]
        total_ref_grade = data["data"]["metaInfo"]["referralTotalGrade"]
        if total_ref_grade:
            balance = total_grade + total_ref_grade
        else:
            balance = total_grade
        total_attempts = data["data"]["metaInfo"]["totalAttempts"]
        consumed_attempts = data["data"]["metaInfo"]["consumedAttempts"]
        attempts_left = total_attempts - consumed_attempts
        is_countdown = data["data"]["metaInfo"]["attemptRefreshCountDownTime"]

        base.log(
            f"{base.green}Balance: {base.white}{balance:,} - {base.green}Tickets Left: {base.white}{attempts_left}"
        )

        return attempts_left, is_countdown
    except:
        return None, None