1+ import requests
2+ import time
13from datetime import datetime
2- from typing import Optional , Tuple , Union
4+ from typing import List , Optional , Tuple , Union
35from .errors import NO_API_KEY_ERROR
4- from .networks import Network
5- from .utils import HexIntStringNumber , ETH_NULL_VALUE , is_hash , is_hex_int
66from .evm_node import POSSIBLE_BLOCK_TAGS , EVM_Node , HEADERS
7- import requests
8- import time
7+ from . networks import Network
8+ from . utils import HexIntStringNumber , ETH_NULL_VALUE , is_hash
99
1010NFT_FILTERS = ["SPAM" , "AIRDROPS" ]
1111
@@ -156,7 +156,7 @@ def _get_all_asset_transfers(
156156 from_block : Union [int , str , None ] = 0 ,
157157 to_block : Union [int , str , None ] = None ,
158158 contract_addresses : Optional [list ] = None ,
159- category : Optional [list [str ]] = [
159+ category : Optional [List [str ]] = [
160160 "external" ,
161161 "internal" ,
162162 "erc20" ,
@@ -202,7 +202,7 @@ def get_asset_transfers(
202202 max_count : Union [int , str , None ] = 1000 ,
203203 page_key : Optional [str ] = None ,
204204 contract_addresses : Optional [list ] = None ,
205- category : Optional [list [str ]] = [
205+ category : Optional [List [str ]] = [
206206 "external" ,
207207 "internal" ,
208208 "erc20" ,
@@ -433,7 +433,7 @@ def base_fee_per_gas(self) -> int:
433433 def get_token_balances (
434434 self ,
435435 address : str ,
436- token_addresses_or_type : Union [list [str ], str , None ] = None ,
436+ token_addresses_or_type : Union [List [str ], str , None ] = None ,
437437 options_or_page_key : Union [dict , str , None ] = None ,
438438 ) -> dict :
439439 """
@@ -520,10 +520,10 @@ def get_nfts_for_owner(
520520 owner : str ,
521521 page_key : Optional [str ] = None ,
522522 page_size : Optional [int ] = 100 ,
523- contract_addresses : Optional [list [str ]] = None ,
523+ contract_addresses : Optional [List [str ]] = None ,
524524 omit_metadata : Optional [bool ] = False ,
525525 token_uri_timeout_in_ms : Union [int , None ] = None ,
526- filters : Optional [list [str ]] = None ,
526+ filters : Optional [List [str ]] = None ,
527527 ) -> dict :
528528 """Gets all NFTs currently owned by a given address.
529529
@@ -553,11 +553,11 @@ def get_nfts(
553553 owner : str ,
554554 page_key : Optional [str ] = None ,
555555 page_size : Optional [int ] = 100 ,
556- contract_addresses : Optional [list [str ]] = None ,
556+ contract_addresses : Optional [List [str ]] = None ,
557557 with_metadata : Optional [bool ] = False ,
558558 token_uri_timeout_in_ms : Union [int , None ] = None ,
559- exclude_filters : Optional [list [str ]] = None ,
560- include_filters : Optional [list [str ]] = None ,
559+ exclude_filters : Optional [List [str ]] = None ,
560+ include_filters : Optional [List [str ]] = None ,
561561 order_by : Optional [str ] = None ,
562562 ) -> dict :
563563 """Gets all NFTs currently owned by a given address.
@@ -691,8 +691,8 @@ def get_contracts_for_owner(
691691 owner : str ,
692692 page_key : Optional [str ] = None ,
693693 page_size : Optional [int ] = 100 ,
694- include_filters : Optional [list [str ]] = None ,
695- exclude_filters : Optional [list [str ]] = None ,
694+ include_filters : Optional [List [str ]] = None ,
695+ exclude_filters : Optional [List [str ]] = None ,
696696 order_by : Optional [str ] = None ,
697697 ) -> dict :
698698 """Gets all contracts for a given owner.
@@ -701,8 +701,8 @@ def get_contracts_for_owner(
701701 owner (str): Owner address to check
702702 page_key (Optional[str], optional): Page key to get the next page of results. Defaults to None.
703703 page_size (Optional[int], optional): Page size to get the next page of results. Defaults to 100.
704- include_filters (Optional[list [str]], optional): Optional list of strings from "SPAM" and "AIRDROPS". Defaults to None.
705- exclude_filters (Optional[list [str]], optional): Optional list of strings from "SPAM" and "AIRDROPS". Defaults to None.
704+ include_filters (Optional[List [str]], optional): Optional list of strings from "SPAM" and "AIRDROPS". Defaults to None.
705+ exclude_filters (Optional[List [str]], optional): Optional list of strings from "SPAM" and "AIRDROPS". Defaults to None.
706706 order_by (Optional[str], optional): Optional string to order by "transferTime" or None. Defaults to None.
707707
708708 Returns:
@@ -956,7 +956,7 @@ def compute_rarity(self, contract_address: str, token_id: Union[str, int]) -> di
956956 return json_response
957957
958958 def verify_nft_ownership (
959- self , wallet_address : str , contract_addresses : Union [str , list [str ]]
959+ self , wallet_address : str , contract_addresses : Union [str , List [str ]]
960960 ) -> dict :
961961 """Verifies if a wallet owns a given NFT.
962962
0 commit comments