A simple way to get different DEXs abis for block chains.
Project description
Many Abis
Get different DEX abis easily for blockchain developers.
Now we support dex:
- arbitrum-one:
- [1] SushiSwap
- avax-c:
- [1] traderjoexyz
- bsc:
- [1] ApeSwap Finance
- [2] BiSwap
- [3] MDEX (BSC)
- [4] PancakeSwap v2
- [5] PancakeSwap v3
- [6] uniswap
- bsc-test:
- cronos:
- eth:
- [1] Uniswap V2
- [2] Uniswap V3
- fantom:
- [1] SpiritSwap
- [2] SpookySwap
- heco:
- [1] MDEX (HECO)
- kcc:
- [1] KoffeeSwap
- moonriver:
- [1] Solarbeam
- okex:
- [1] CherrySwap
- polygon:
- [1] QuickSwap
Installation
- Download
pip install many-abis
# pypi
pip install -i https://pypi.org/simple many-abis
# update
pip install -U many-abis
# or
pip install -U -i https://pypi.org/simple many-abis
Usage
import many_abis as ma
# ======================================================================
# get all abi names
print(ma.ALL_ABIS_NAME)
# get all abis
print(ma.ABIS)
# you can access ABI by dot name
print(ma.ABIS.ERC20)
# ======================================================================
# get abi from address using etherscan api
ma.get_abi_from_address(
"0x0841BD0B734E4F5853f0dD8d7Ea041c241fb0Da6",
"YOUR API KEY",
ma.CHAIN_CONTRACT_API.BSC
)
# ======================================================================
# chains
chains = ma.all_chains()
print(chains)
# ['arbitrum-one', 'avax-c', 'bsc', 'bsc-test', 'cronos', 'eth', 'fantom', 'heco', 'kcc', 'moonriver', 'okex', 'polygon']
# different methods to get chain
bsc = ma.get_chain_by_id(chain_id=56)
bsc = ma.get_chain_by_name(name="bsc")
bsc = ma.get_chain(name="bsc")
bsc = ma.get_chain(chain_id=56)
bsc = ma.chain(name="bsc")
bsc = ma.chain(chain_id=56)
print(bsc)
# to get some items from chain
eth_weth = ma.get('eth', 'weth')
print(eth_weth)
# {'address': '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 'name': 'Wrapped ETH', 'symbol': 'WETH'}
ds = ma.get('bsc', 'dex', 'pancake_v2')
print(ds)
# {'factory_address': '0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73', 'name': 'PancakeSwap v2', 'router_address': '0x10ED43C718714eb63d5aA57B78B54704E256024E', 'website': 'https://pancakeswap.finance/swap'}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
many_abis-0.1.5.tar.gz
(39.3 kB
view hashes)
Built Distribution
many_abis-0.1.5-py3-none-any.whl
(58.1 kB
view hashes)
Close
Hashes for many_abis-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 459f276f43745a91fbc3be5d08f48aa1103b29bec2d007d6c443fad8330242b7 |
|
MD5 | bbc7d6aca560ebeb175131d2af938a5d |
|
BLAKE2b-256 | 645a06d0ff64d730fbd15365130ae12d37cc3157a2356260b23e867d70b693ed |