diff --git a/many_abis/assets/BSC/__init__.py b/many_abis/assets/BSC/__init__.py index 100092d..0884502 100644 --- a/many_abis/assets/BSC/__init__.py +++ b/many_abis/assets/BSC/__init__.py @@ -17,9 +17,20 @@ 'USDC': '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d', } +CHARTS = { + 'default': 'https://poocoin.app/tokens/{address}', + 'poocoin': 'https://poocoin.app/tokens/{address}', + 'dextools': 'https://www.dextools.io/app/pancakeswap/pair-explorer/{address}', + 'dex.guru': 'https://dex.guru/token/{address}-bsc', + 'bogged': 'https://charts.bogged.finance/?token={address}', + 'avedex':'https://avedex.org/token/{address}', + 'Sell/Buy On Pancake-V2': 'https://exchange.pancakeswap.finance/#/swap?outputCurrency={address}', +} + BASIC = { 'chain': 'Binance Smart Chain', 'explorer': 'https://bscscan.com/', 'weth' : WETH, - 'coins': COINS + 'coins': COINS, + 'charts': CHARTS, } diff --git a/many_abis/assets/BSC_TEST/__init__.py b/many_abis/assets/BSC_TEST/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/many_abis/assets/ETH/__init__.py b/many_abis/assets/ETH/__init__.py index e2bf777..91ed5f9 100644 --- a/many_abis/assets/ETH/__init__.py +++ b/many_abis/assets/ETH/__init__.py @@ -10,17 +10,23 @@ 'abi': W_ERC20_ABI, } - COINS = { 'USDT': '0xdAC17F958D2ee523a2206206994597C13D831ec7', 'USDC': '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', 'DAI': '0x6B175474E89094C44Da98b954EedeAC495271d0F', } +CHARTS = { + 'default': 'https://www.dextools.io/app/uniswap/pair-explorer/{address}', + 'dextools': 'https://www.dextools.io/app/uniswap/pair-explorer/{address}', + 'Sell/Buy On Uniswap-V2': 'https://app.uniswap.org/#/swap?outputCurrency={address}&use=V2', +} + BASIC = { 'chain': 'Ethereum Chain', 'explorer': 'https://etherscan.io/', 'weth' : WETH, - 'coins': COINS + 'coins': COINS, + 'charts': CHARTS, } diff --git a/many_abis/assets/HECO/__init__.py b/many_abis/assets/HECO/__init__.py index a93e456..c5a08ab 100644 --- a/many_abis/assets/HECO/__init__.py +++ b/many_abis/assets/HECO/__init__.py @@ -17,9 +17,18 @@ } +CHARTS = { + 'default': 'https://info.nut.money/token/{address}', + 'pippi': 'https://info.pippi.finance/token/{address}', # only support + 'nut': 'https://info.nut.money/token/{address}', + 'xfarmer': 'https://xfarmer.net/trade.html?pair_address={address}', # xfarmer shold input pair address + 'Sell/Buy On MDEX-HECO': 'https://ht.mdex.co/#/swap?outputCurrency={address}', +} + BASIC = { 'chain': 'Huobi Eco Chain', 'explorer': 'https://hecoinfo.com/', 'weth' : WETH, - 'coins': COINS + 'coins': COINS, + 'charts': CHARTS, } diff --git a/many_abis/assets/KCC/__init__.py b/many_abis/assets/KCC/__init__.py index 2a1b234..ec483b1 100644 --- a/many_abis/assets/KCC/__init__.py +++ b/many_abis/assets/KCC/__init__.py @@ -15,9 +15,16 @@ 'USDC': '0x980a5afef3d17ad98635f6c5aebcbaeded3c3430' } +CHARTS = { + 'default': 'https://koffeeswap.exchange/#/pro', + 'koffeeswap': 'https://koffeeswap.exchange/#/pro', + 'Sell/Buy On KoffeeSwap': 'https://koffeeswap.exchange/#/swap?outputCurrency={address}', +} + BASIC = { 'chain': 'KuCoin Community Chain', 'explorer': 'https://explorer.kcc.io/en/', 'weth' : WETH, - 'coins': COINS + 'coins': COINS, + 'charts': CHARTS, } diff --git a/many_abis/assets/MATIC/__init__.py b/many_abis/assets/MATIC/__init__.py index 0d42a2a..707a4ff 100644 --- a/many_abis/assets/MATIC/__init__.py +++ b/many_abis/assets/MATIC/__init__.py @@ -16,9 +16,20 @@ 'PUSD': '0x9af3b7dc29d3c4b1a5731408b6a9656fa7ac3b72' } +CHARTS = { + 'default': 'https://app.polychart.io/explorer/polygon/{address}', + 'poocoin': 'https://polygon.poocoin.app/tokens/{address}', + 'kek': 'https://kek.tools/t/{address}', + 'quickcharts': 'https://quickchart.app/token/{address}', + 'polychart': 'https://app.polychart.io/explorer/polygon/{address}', + 'dex.guru': 'https://dex.guru/token/{address}-polygon', + 'Sell/Buy On QuickSwap': 'https://quickswap.exchange/#/swap?outputCurrency={address}', +} + BASIC = { 'chain': 'Polygon PoS Chain', 'explorer': 'https://polygonscan.com/', 'weth' : WETH, - 'coins': COINS + 'coins': COINS, + 'charts': CHARTS, } \ No newline at end of file diff --git a/many_abis/utils/__init__.py b/many_abis/utils/__init__.py index fb07476..048fe7b 100644 --- a/many_abis/utils/__init__.py +++ b/many_abis/utils/__init__.py @@ -16,13 +16,11 @@ def get_abi_from_address(address, api_key, chain_api=contract_api.BSC): session.close() result = eval(result.content.decode()) - if result['status'] == '1' and result['message'] == 'OK': return result['result'] else: return None - def get_factory_from_router(router_address, api_key, chain_api=contract_api.BSC, rpc=rpc.BSC): web3 = Web3(Web3.HTTPProvider(rpc)) router_address = web3.toChecksumAddress(router_address) @@ -50,7 +48,6 @@ def assert_dex_supported(chain, dex): support_dex = get_support_dex(chain) assert dex in support_dex, f"{dex} is not supported, support = {support_dex}" - def get_chain(chain='BSC'): return get_chain_info(chain) @@ -62,6 +59,10 @@ def get_chain_module(chain='BSC'): chain_module = importlib.import_module(f".assets.{chain}", package='many_abis') return chain_module +def get_chain_charts(chain='BSC'): + chain_module = get_chain_module(chain) + return chain_module.CHARTS + def get_chain_info(chain='BSC'): chain_module = get_chain_module(chain) return chain_module.BASIC @@ -78,7 +79,6 @@ def get_chain_explorer(chain='BSC'): chain_module = get_chain_module(chain) return chain_module.BASIC['explorer'] - def get_support_dex(chain='BSC'): chain_module = get_chain_module(chain) return chain_module.SUPPORT_DEX @@ -92,7 +92,6 @@ def get_dex(chain='BSC', dex='pancake_v2'): dex_module = get_dex_module(chain, dex) return dex_module.DEX - def get_module(chain, dex): return get_chain_module(chain), get_dex_module(chain, dex) @@ -101,7 +100,6 @@ def get(chain, dex): dex = get_dex(chain, dex) return basic, dex - def print_all_support(): for i, chain in enumerate(SUPPORT_CHAIN): print(f"- {chain}:") diff --git a/setup.py b/setup.py index 38f42e3..4cb82f2 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name = 'many_abis', packages = find_packages(), - version = '0.0.5', + version = '0.0.6', license='MIT', description = 'A simple way to get different DEXs abis for block chains.', author = 'Yong',