etwnn / scanwatch Goto Github PK
View Code? Open in Web Editor NEWLocal tracker for address on Ethereum, BSC and Polygon chains
License: MIT License
Local tracker for address on Ethereum, BSC and Polygon chains
License: MIT License
After
Client.py:
"""BASE_BSC_URL = "https://api.bscscan.com/api" # mainnet"""
BASE_BSC_URL = "https://api-testnet.bscscan.com/api" # testnet
I'm got an Error:
Traceback (most recent call last):
File "scanw.py", line 11, in
manager.update_all_transactions()
.........
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Mainnet endpoint works fine. Possible solution?
Can you work around this without raising an exception?
Hi. Repository discussion tab seems missing you can add it in settings.
Feature request:
Get address current erc20/erc721 (bep20/bep721) holdings.
My idea of implementation:
My implementation of bep721 holdings:
from ScanWatch import ScanManager
from ScanWatch.utils.enums import NETWORK, TRANSACTION
api_token = ""
address = "0x8477f08df0d70f3b19e6241dcb1757363741ed7e"
manager = ScanManager(address, NETWORK.BSC, api_token, "test")
# manager.get_transactions(TRANSACTION.NORMAL) # normal transactions
manager.update_all_transactions()
result = manager.get_transactions(TRANSACTION.ERC721)
trans_in = []
trans_out = []
print('Transactions: ')
for res in result:
if res['from'] == address:
trans_out.append(res)
side = 'out'
else:
trans_in.append(res)
side = 'in'
print(f"from: {res['from']} / {side} / to: {res['to']} / contract: {res['contractAddress']} / token: {res['tokenID']} - {res['tokenName']} - {res['tokenSymbol']}")
final = trans_in
for x in trans_in:
for out in trans_out:
if (out['contractAddress'] == x['contractAddress'] and
out['tokenID'] == x['tokenID'] and
out['tokenName'] == x['tokenName'] and
out['tokenSymbol'] == x['tokenSymbol']):
final.remove(x)
print('Holdings: ')
for res in final:
print(f"from: {res['from']} / to: {res['to']} / contract: {res['contractAddress']} / token: {res['tokenID']} - {res['tokenName']} - {res['tokenSymbol']}")
I'm not clearly sure if this is the right way of implementation (don't know how this will work if transactions failed etc.)
If you can natively implement this functional into library that's would be nice. Maybe you can do this with better/safer/optimized way
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.