QPython Series: Check LikeCoin Wallet Balance on Your Phone
When you see this title, do you want to ask, to check the LikeCoin wallet balance is not to open LikerLand?
If you only have one LikerLand account, it's fine to open the app, but for people with more than one Matters account to see the wallet balance, you have to log out and log in again. It's even worse if you use the Kelper wallet, you can't watch it without turning on the computer.
⏺ Applicable people
❇️ Hold more than one Liker Land account
❇️ Want to see the LikeCoin balance of Kepler wallet on your phone
❇️ Android phone users (no way, the uncle is not using an iPhone)
⏺ Introduction
Because the uncle's hands are too itchy, he made several LikeCoin wallets scattered, and after a long time, he can't figure out how much money is in that wallet, and what rewards should he get out? I just saw that @Kuàn-ka recently published an article with the source code directly attached to the text, so I decided to use it for modification.
The first time you use it, you need to download QPython from the Google Store and make some settings. After completion, just open the App and run the script to get the following results.
⏺ Installation Instructions
The required tools and materials are:
❇️ QPython ( free download on Google Play)
❇️ Your LikeCoin wallet address (will be explained later)
❇️ The code written by the uncle (because it is too long, put it at the end of the article, or click here to open it)
Add the required Python libraries:
- Click on the App, if the App and you want permission, click OK. See the menu point "QPYPI".
- First click "Pip console" to install a library that needs to be used.
- Enter "pip3 install requests", refer to the picture.
- Press the Enter key to issue the command entered in the previous step.
- Wait until the arrow (-->) reappears and it's done.
Build script:
- Open the editor, copy and paste the code.
- Click the save button and select "scrpts3" to save the script.
- Enter a script name that is easy for you to identify, the end must be ".py", and click the tick button to save the script.
Run the script:
- Click Programs.
- Click the script to run.
- Click "Run".
- After the script finishes running, the time required will be affected by the number of wallets and the speed of the network. The two wallets in the figure only take a few seconds.
How to find the wallet address:
The leftmost picture below is how to find the address of Kepler wallet, and the other three pictures are from LikerLand.
- Click on "My Wallet".
- Click "Receive Payment".
- Click "Copy" to copy the wallet address.
⏺ Notice of the next issue
In addition to watching the LikeCoin wallet, I am also doing a script to read various currency wallets with one click, and a script to read the currency price with one click. If you want to see it, please clap your hands a lot, otherwise I will misunderstand that no one will see it, maybe I will use it myself instead of posting it~
⏺ Code
You can enter up to 10 wallet addresses, just replace " your wallet address 1 " in the code below with your own wallet address, and enter wallet[1] , wallet[2] , wallet[3 for other wallets in sequence ] between the quotation marks after it.
The code can also be found here .
import requests requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = "TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:ECDHE:!COMPLEMENTOFDEFAULT" from datetime import datetime wallet=['','','','','','','','','',''] wallet[0]='Your wallet address 1' wallet[1]='' wallet[2]='' wallet[3]='' wallet[4]='' wallet[5]='' wallet[6]='' wallet[7]='' wallet[8]='' wallet[9]='' def GetLikeWalletInfo(address): for x in range(3): if (x == 0): url = "https://mainnet-node.like.co/cosmos/bank/v1beta1/balances/" + address res = requests.get(url) data = res.json() rAmt = 0 sChecker = str(data) if sChecker[:7] !="{'code'": DD1 = data['balances'] for DD2 in DD1: aAmt = DD2['amount'] aAmt = float(aAmt) /pow(10,9) elif(x == 1): url = "https://mainnet-node.like.co/cosmos/distribution/v1beta1/delegators/" + address + "/rewards" res = requests.get(url) data = res.json() rAmt = 0 sChecker = str(data) if sChecker[:7] !="{'code'": DD1 = data['rewards'] for DD2 in DD1: DD3 = DD2['reward'] for DD4 in DD3: rAmt = rAmt + float(DD4['amount']) rAmt = float(rAmt) /pow(10,9) elif(x == 2): url = "https://mainnet-node.like.co/cosmos/staking/v1beta1/delegations/" + address res = requests.get(url) data = res.json() sAmt = 0 sChecker = str(data) if sChecker[:7] !="{'code'": DD1 = data['delegation_responses'] for DD2 in DD1: #print(DD2['balance']['amount']) sAmt = sAmt + float(DD2['balance']['amount']) sAmt = float(sAmt) /pow(10,9) print(f"{address[-4:] :>4}{int(aAmt) :>7}{int(rAmt) :>7}{int(sAmt) :>7}") dt = datetime.today().isoformat()[:19].replace("T", " ") print('') print('Your LikeCoin wallet balance is inquiring...') print("Start time:",dt) print('-'*30) print(f"{'Wallet':<4}{'Balance':^7}{'Reward':<7}{'Delegation':<7}") for x in range(len(wallet)): if wallet[x] != '': GetLikeWalletInfo(wallet[x]) print('-'*30) dt = datetime.today().isoformat()[:19].replace("T", " ") print ("Update complete:",dt) print('')
Like my work? Don't forget to support and clap, let me know that you are with me on the road of creation. Keep this enthusiasm together!