Spaces:
Sleeping
Sleeping
Update components/checktoken.py
Browse files- components/checktoken.py +5 -6
components/checktoken.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
def TokenCheck(
|
| 2 |
|
| 3 |
|
| 4 |
|
|
@@ -9,8 +9,8 @@ def TokenCheck(walletPublicKey,required_mint,mint_amount):
|
|
| 9 |
"id": "1",
|
| 10 |
"method": "getTokenAccountsByOwner",
|
| 11 |
"params": [
|
| 12 |
-
|
| 13 |
-
{"mint":
|
| 14 |
{"encoding": "jsonParsed"}
|
| 15 |
]
|
| 16 |
}
|
|
@@ -24,7 +24,7 @@ def TokenCheck(walletPublicKey,required_mint,mint_amount):
|
|
| 24 |
|
| 25 |
except requests.exceptions.RequestException as e:
|
| 26 |
|
| 27 |
-
return
|
| 28 |
|
| 29 |
|
| 30 |
token_accounts = data.get("result", {}).get("value")
|
|
@@ -47,9 +47,8 @@ def TokenCheck(walletPublicKey,required_mint,mint_amount):
|
|
| 47 |
|
| 48 |
if int(ui_amount) >= required_mint:
|
| 49 |
|
| 50 |
-
print(ui_amount)
|
| 51 |
-
|
| 52 |
return True
|
|
|
|
| 53 |
else:
|
| 54 |
return False
|
| 55 |
|
|
|
|
| 1 |
+
def TokenCheck(address):
|
| 2 |
|
| 3 |
|
| 4 |
|
|
|
|
| 9 |
"id": "1",
|
| 10 |
"method": "getTokenAccountsByOwner",
|
| 11 |
"params": [
|
| 12 |
+
address,
|
| 13 |
+
{"mint": "3d4XyPWkUJzruF5c2qc1QfpLgsaNaDLMtTya1bWBpump"},
|
| 14 |
{"encoding": "jsonParsed"}
|
| 15 |
]
|
| 16 |
}
|
|
|
|
| 24 |
|
| 25 |
except requests.exceptions.RequestException as e:
|
| 26 |
|
| 27 |
+
return False
|
| 28 |
|
| 29 |
|
| 30 |
token_accounts = data.get("result", {}).get("value")
|
|
|
|
| 47 |
|
| 48 |
if int(ui_amount) >= required_mint:
|
| 49 |
|
|
|
|
|
|
|
| 50 |
return True
|
| 51 |
+
|
| 52 |
else:
|
| 53 |
return False
|
| 54 |
|