-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWalletReader.py
54 lines (37 loc) · 1.65 KB
/
WalletReader.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
import requests
import json
etherScanApiKey= "APAAAC91153QR2AKTUYP2F33TSTEN1MG7V"
infuraApiKey= "3c796ecbf3df47bd81d8e6025521050f"
myAddr="0x40dE8Fa4B917Ce19648CadC5E04E03d231dea63c"
response = requests.get("https://api.etherscan.io/api?"
"module=account"
"&action=balance"
"&address=" + myAddr +
"&tag=latest"
"&apikey=" + etherScanApiKey
)
jsonParser: int = json.loads(response.text)
value = jsonParser.get("result")
print (value + " wei")
print (int(value) / 1000000000000000000 , "ETH")
response_infura = requests.get("https://mainnet.infura.io/v3/3c796ecbf3df47bd81d8e6025521050f")
### token 전체 목록 읽어오기 ###
ITAMCUBE = "0xbbab3bdb291b0f22bc9881895ff488a5db67bec8"
tokenInfo = requests.get("https://api.etherscan.io/api?"
"module=token"
"&action=tokeninfo"
"&contractaddress=" + ITAMCUBE +
"&apikey=" + etherScanApiKey
)
response = requests.get("https://api.etherscan.io/api?"
"module=account"
"&action=tokenbalance"
"&contractaddress=" + ITAMCUBE +
"&address=" + myAddr +
"&tag=latest"
"&apikey=" + etherScanApiKey
)
jsonParser: int = json.loads(response.text)
value = jsonParser.get("result")
print (value + " wei")
print (int(value) / 1000000000000000000 , "CUBE")