|
1 | | -from collections import namedtuple |
| 1 | +import functools |
| 2 | +import logging |
2 | 3 | import os |
3 | 4 | import time |
4 | | -import logging |
5 | | -import functools |
6 | | -from typing import List, Any, Optional, Sequence, Union, Tuple, Iterable, Dict |
| 5 | +from collections import namedtuple |
| 6 | +from typing import ( |
| 7 | + Any, |
| 8 | + Dict, |
| 9 | + Iterable, |
| 10 | + List, |
| 11 | + Optional, |
| 12 | + Sequence, |
| 13 | + Tuple, |
| 14 | + Union, |
| 15 | +) |
7 | 16 |
|
| 17 | +from eth_typing.evm import Address, ChecksumAddress |
| 18 | +from hexbytes import HexBytes |
8 | 19 | from web3 import Web3 |
9 | 20 | from web3._utils.abi import map_abi_data |
10 | 21 | from web3._utils.normalizers import BASE_RETURN_NORMALIZERS |
11 | 22 | from web3.contract import Contract |
12 | 23 | from web3.contract.contract import ContractFunction |
13 | 24 | from web3.exceptions import BadFunctionCallOutput, ContractLogicError |
14 | 25 | from web3.types import ( |
| 26 | + Nonce, |
15 | 27 | TxParams, |
16 | 28 | TxReceipt, |
17 | 29 | Wei, |
18 | | - Nonce, |
19 | 30 | ) |
20 | | -from eth_typing.evm import Address, ChecksumAddress |
21 | | -from hexbytes import HexBytes |
22 | | -from .types import AddressLike |
| 31 | + |
| 32 | +from .constants import ( |
| 33 | + ETH_ADDRESS, |
| 34 | + MAX_TICK, |
| 35 | + MAX_UINT_128, |
| 36 | + MIN_TICK, |
| 37 | + WETH9_ADDRESS, |
| 38 | + _factory_contract_addresses_v1, |
| 39 | + _factory_contract_addresses_v2, |
| 40 | + _netid_to_name, |
| 41 | + _router_contract_addresses_v2, |
| 42 | + _tick_bitmap_range, |
| 43 | + _tick_spacing, |
| 44 | +) |
| 45 | +from .decorators import check_approval, supports |
| 46 | +from .exceptions import InsufficientBalance, InvalidToken |
23 | 47 | from .token import ERC20Token |
24 | | -from .exceptions import InvalidToken, InsufficientBalance |
| 48 | +from .types import AddressLike |
25 | 49 | from .util import ( |
26 | | - _get_eth_simple_cache_middleware, |
27 | | - _str_to_addr, |
28 | 50 | _addr_to_str, |
29 | | - _validate_address, |
| 51 | + _get_eth_simple_cache_middleware, |
30 | 52 | _load_contract, |
31 | 53 | _load_contract_erc20, |
| 54 | + _str_to_addr, |
| 55 | + _validate_address, |
32 | 56 | chunks, |
33 | 57 | encode_sqrt_ratioX96, |
34 | 58 | is_same_address, |
35 | 59 | nearest_tick, |
36 | 60 | realised_fee_percentage, |
37 | 61 | ) |
38 | | -from .decorators import supports, check_approval |
39 | | -from .constants import ( |
40 | | - MAX_UINT_128, |
41 | | - MAX_TICK, |
42 | | - MIN_TICK, |
43 | | - WETH9_ADDRESS, |
44 | | - _netid_to_name, |
45 | | - _factory_contract_addresses_v1, |
46 | | - _factory_contract_addresses_v2, |
47 | | - _router_contract_addresses_v2, |
48 | | - _tick_spacing, |
49 | | - _tick_bitmap_range, |
50 | | - ETH_ADDRESS, |
51 | | -) |
52 | 62 |
|
53 | 63 | logger = logging.getLogger(__name__) |
54 | 64 |
|
|
0 commit comments