Skip to content

Commit

Permalink
Merge pull request #4 from ackness/v0.1.4-dev1
Browse files Browse the repository at this point in the history
V0.1.4 dev1
  • Loading branch information
ackness authored Mar 24, 2023
2 parents f1686b7 + d191262 commit 62bdcf7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Many Abis

![Version](https://img.shields.io/badge/many--abis-v0.1.4-green)
![Version](https://img.shields.io/badge/many--abis-v0.1.4.1-green)
![Pypi](https://img.shields.io/pypi/dm/many-abis)

![GitHub Org's stars](https://img.shields.io/github/stars/ackness/many_abis?style=social)
Expand Down
3 changes: 3 additions & 0 deletions examples/example1.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@

# print all support dex
ma.print_all_dex()

bsc = ma.from_id(chain_id=56)
print(bsc)
8 changes: 7 additions & 1 deletion many_abis/chains/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@
SUPPORT_CHAIN = ['BSC', 'ETH', 'AVAX', 'FANTOM', 'POLYGON', 'CRONOS',
'HECO', 'KCC', 'OKEX', 'MOONRIVER', 'ARBITRUM', 'BSC_TEST']
__all__ = ['SUPPORT_CHAIN', 'BSC', 'ETH', 'AVAX', 'FANTOM', 'CRONOS',
'POLYGON', 'HECO', 'KCC', 'OKEX', 'MOONRIVER', 'BSC_TEST', 'ARBITRUM', 'CHAINS']
'POLYGON', 'HECO', 'KCC', 'OKEX', 'MOONRIVER', 'BSC_TEST', 'ARBITRUM', 'CHAINS', 'from_id']

CHAINS = AttributeDict(
**{name: eval(name) for name in SUPPORT_CHAIN}
)

def from_id(chain_id: int):
return next(
(chain[1] for chain in CHAINS.items() if chain[1].chain_id == chain_id),
None,
)
2 changes: 1 addition & 1 deletion many_abis/chains/_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__all__ = [
'UNISWAP_V2_ROUTER_ABI', 'UNISWAP_V2_FACTORY_ABI', 'UNISWAP_V2_PAIR_ABI',
'UNISWAP_V3_ROUTER_ABI', 'UNISWAP_V3_FACTORY_ABI', 'UNISWAP_V3_POOL_ABI',
'UNISWAP_V3_QUOTER_ABI', 'UNISWAP_V3_NFT_POSITION_MANAGER_ABI', 'UNISWAP_V3_NFT_POSITION_ABI',
'UNISWAP_V3_QUOTER_ABI', 'UNISWAP_V3_NON_FUNGIBLE_POSITION_MANAGER_ABI', 'UNISWAP_V3_MULTICALL_ABI',
'WETH_ABI',
'STANDARD_ERC20_TOKEN_ABI', 'STANDARD_ERC721_TOKEN_ABI', 'STANDARD_ERC777_TOKEN_ABI', 'STANDARD_ERC1155_TOKEN_ABI',
'AVAX_JOE_ROUTER_ABI', 'AVAX_JOE_FACTORY_ABI', 'AVAX_JOE_PAIR_ABI'
Expand Down
2 changes: 1 addition & 1 deletion many_abis/chains/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ def __init__(
)

def __repr__(self):
return f'Chain Name: {self.name}, Explorer: {self.explorer}, DEX: {self.dex.keys()}'
return f'Chain Name: {self.name}, ID: {self.chain_id}, Explorer: {self.explorer}, DEX: {self.dex.keys()}'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
setup(
name='many_abis',
packages=find_packages(),
version='0.1.4',
version='0.1.4.1',
license='MIT',
description='A simple way to get different DEXs abis for block chains.',
long_description=long_description,
Expand Down

0 comments on commit 62bdcf7

Please sign in to comment.