diff --git a/ankr/types.py b/ankr/types.py index 48a7d80..b2bb642 100644 --- a/ankr/types.py +++ b/ankr/types.py @@ -4,21 +4,14 @@ class SyncStatus: - def __init__(self, - lag: str, - status: str, - timestamp: float): + def __init__(self, lag: str, status: str, timestamp: float): self.lag = lag self.status = status self.timestamp = timestamp class MethodInput: - def __init__(self, - name: str, - size: float, - type: str, - valueDecoded: str): + def __init__(self, name: str, size: float, type: str, valueDecoded: str): self.name = name self.size = size self.type = type @@ -26,13 +19,15 @@ def __init__(self, class Method: - def __init__(self, - id: str, - inputs: List[MethodInput], - name: str, - signature: str, - string: str, - verified: bool): + def __init__( + self, + id: str, + inputs: List[MethodInput], + name: str, + signature: str, + string: str, + verified: bool, + ): self.id = id self.inputs = inputs self.name = name @@ -42,12 +37,9 @@ def __init__(self, class EventInput: - def __init__(self, - indexed: bool, - name: str, - size: float, - type: str, - valueDecoded: str): + def __init__( + self, indexed: bool, name: str, size: float, type: str, valueDecoded: str + ): self.indexed = indexed self.name = name self.size = size @@ -56,14 +48,16 @@ def __init__(self, class Event: - def __init__(self, - anonymous: bool, - id: str, - inputs: List[EventInput], - name: str, - signature: str, - string: str, - verified: bool): + def __init__( + self, + anonymous: bool, + id: str, + inputs: List[EventInput], + name: str, + signature: str, + string: str, + verified: bool, + ): self.anonymous = anonymous self.id = id self.inputs = inputs @@ -74,18 +68,20 @@ def __init__(self, class Log: - def __init__(self, - address: str, - blockHash: str, - blockNumber: str, - blockchain: Blockchain, - data: str, - logIndex: str, - removed: bool, - topics: List[str], - transactionHash: str, - transactionIndex: str, - event: Event = None): + def __init__( + self, + address: str, + blockHash: str, + blockNumber: str, + blockchain: Blockchain, + data: str, + logIndex: str, + removed: bool, + topics: List[str], + transactionHash: str, + transactionIndex: str, + event: Event = None, + ): self.address = address self.blockHash = blockHash self.blockNumber = blockNumber @@ -100,30 +96,32 @@ def __init__(self, class Transaction: - def __init__(self, - blockHash: str, - blockNumber: str, - from_: str, - transactionIndex: str, - value: str, - gasPrice: str = None, - gas: str = None, - contractAddress: str = None, - cumulativeGasUsed: str = None, - input: str = None, - v: str = None, - r: str = None, - s: str = None, - method: Method = None, - to: str = None, - nonce: str = None, - gasUsed: str = None, - logs: List[Log] = None, - hash: str = None, - status: str = None, - blockchain: str = None, - timestamp: str = None, - type: str = None): + def __init__( + self, + blockHash: str, + blockNumber: str, + from_: str, + transactionIndex: str, + value: str, + gasPrice: str = None, + gas: str = None, + contractAddress: str = None, + cumulativeGasUsed: str = None, + input: str = None, + v: str = None, + r: str = None, + s: str = None, + method: Method = None, + to: str = None, + nonce: str = None, + gasUsed: str = None, + logs: List[Log] = None, + hash: str = None, + status: str = None, + blockchain: str = None, + timestamp: str = None, + type: str = None, + ): self.blockHash = blockHash self.blockNumber = blockNumber self.from_ = from_ @@ -150,28 +148,30 @@ def __init__(self, class Block: - def __init__(self, - difficulty: str, - extraData: str, - gasLimit: str, - gasUsed: str, - hash: str, - logsBloom: str, - miner: str, - mixHash: str, - nonce: str, - number: str, - parentHash: str, - receiptsRoot: str, - sha3Uncles: str, - size: str, - stateRoot: str, - timestamp: str, - totalDifficulty: str, - transactions: List[Transaction], - transactionsRoot: str, - uncles: List[str], - blockchain: str = None): + def __init__( + self, + difficulty: str, + extraData: str, + gasLimit: str, + gasUsed: str, + hash: str, + logsBloom: str, + miner: str, + mixHash: str, + nonce: str, + number: str, + parentHash: str, + receiptsRoot: str, + sha3Uncles: str, + size: str, + stateRoot: str, + timestamp: str, + totalDifficulty: str, + transactions: List[Transaction], + transactionsRoot: str, + uncles: List[str], + blockchain: str = None, + ): self.difficulty = difficulty self.extraData = extraData self.gasLimit = gasLimit @@ -196,31 +196,35 @@ def __init__(self, class GetBlocksReply: - def __init__(self, - blocks: List[Block], - syncStatus: SyncStatus = None): + def __init__(self, blocks: List[Block], syncStatus: SyncStatus = None): self.blocks = blocks self.syncStatus = syncStatus @classmethod def from_dict(cls, **data): return cls( - blocks=data.get('blocks'), - syncStatus=data.get('syncStatus'), + blocks=data.get("blocks"), + syncStatus=data.get("syncStatus"), ) class GetBlocksRequest: - def __init__(self, - blockchain: Blockchain, - fromBlock: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - toBlock: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - descOrder: bool = None, - includeLogs: bool = None, - includeTxs: bool = None, - decodeLogs: bool = None, - decodeTxData: bool = None, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain, + fromBlock: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + toBlock: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + descOrder: bool = None, + includeLogs: bool = None, + includeTxs: bool = None, + decodeLogs: bool = None, + decodeTxData: bool = None, + syncCheck: bool = None, + ): self.blockchain = blockchain self.fromBlock = fromBlock self.toBlock = toBlock @@ -235,47 +239,50 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'fromBlock': self.fromBlock, - 'toBlock': self.toBlock, - 'descOrder': self.descOrder, - 'includeLogs': self.includeLogs, - 'includeTxs': self.includeTxs, - 'decodeLogs': self.decodeLogs, - 'decodeTxData': self.decodeTxData, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "fromBlock": self.fromBlock, + "toBlock": self.toBlock, + "descOrder": self.descOrder, + "includeLogs": self.includeLogs, + "includeTxs": self.includeTxs, + "decodeLogs": self.decodeLogs, + "decodeTxData": self.decodeTxData, + "syncCheck": self.syncCheck, } class GetTransactionsByHashReply: - def __init__(self, - transactions: List[Transaction], - syncStatus: SyncStatus = None): + def __init__(self, transactions: List[Transaction], syncStatus: SyncStatus = None): self.transactions = transactions self.syncStatus = syncStatus @classmethod def from_dict(cls, **data): return cls( - transactions=data.get('transactions'), - syncStatus=data.get('syncStatus'), + transactions=data.get("transactions"), + syncStatus=data.get("syncStatus"), ) class GetTransactionsByHashRequest: - def __init__(self, - transactionHash: str, - blockchain: Blockchain | List[Blockchain] = None, - includeLogs: bool = None, - decodeLogs: bool = None, - decodeTxData: bool = None, - syncCheck: bool = None): + def __init__( + self, + transactionHash: str, + blockchain: Blockchain | List[Blockchain] = None, + includeLogs: bool = None, + decodeLogs: bool = None, + decodeTxData: bool = None, + syncCheck: bool = None, + ): self.transactionHash = transactionHash self.blockchain = blockchain self.includeLogs = includeLogs @@ -287,26 +294,31 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'transactionHash': self.transactionHash, - 'blockchain': blockchain_value, - 'includeLogs': self.includeLogs, - 'decodeLogs': self.decodeLogs, - 'decodeTxData': self.decodeTxData, - 'syncCheck': self.syncCheck, + "transactionHash": self.transactionHash, + "blockchain": blockchain_value, + "includeLogs": self.includeLogs, + "decodeLogs": self.decodeLogs, + "decodeTxData": self.decodeTxData, + "syncCheck": self.syncCheck, } class GetTransactionsByAddressReply: - def __init__(self, - nextPageToken: str, - transactions: List[Transaction], - syncStatus: SyncStatus = None): + def __init__( + self, + nextPageToken: str, + transactions: List[Transaction], + syncStatus: SyncStatus = None, + ): self.nextPageToken = nextPageToken self.transactions = transactions self.syncStatus = syncStatus @@ -314,25 +326,35 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - nextPageToken=data.get('nextPageToken'), - transactions=data.get('transactions'), - syncStatus=data.get('syncStatus'), + nextPageToken=data.get("nextPageToken"), + transactions=data.get("transactions"), + syncStatus=data.get("syncStatus"), ) class GetTransactionsByAddressRequest: - def __init__(self, - address: List[str], - blockchain: Blockchain | List[Blockchain], - fromBlock: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - toBlock: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - fromTimestamp: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - toTimestamp: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - pageToken: str = None, - pageSize: float = None, - descOrder: bool = None, - includeLogs: bool = None, - syncCheck: bool = None): + def __init__( + self, + address: List[str], + blockchain: Blockchain | List[Blockchain], + fromBlock: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + toBlock: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + fromTimestamp: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + toTimestamp: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + pageToken: str = None, + pageSize: float = None, + descOrder: bool = None, + includeLogs: bool = None, + syncCheck: bool = None, + ): self.address = address self.blockchain = blockchain self.fromBlock = fromBlock @@ -349,31 +371,33 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'address': self.address, - 'blockchain': blockchain_value, - 'fromBlock': self.fromBlock, - 'toBlock': self.toBlock, - 'fromTimestamp': self.fromTimestamp, - 'toTimestamp': self.toTimestamp, - 'pageToken': self.pageToken, - 'pageSize': self.pageSize, - 'descOrder': self.descOrder, - 'includeLogs': self.includeLogs, - 'syncCheck': self.syncCheck, + "address": self.address, + "blockchain": blockchain_value, + "fromBlock": self.fromBlock, + "toBlock": self.toBlock, + "fromTimestamp": self.fromTimestamp, + "toTimestamp": self.toTimestamp, + "pageToken": self.pageToken, + "pageSize": self.pageSize, + "descOrder": self.descOrder, + "includeLogs": self.includeLogs, + "syncCheck": self.syncCheck, } class GetLogsReply: - def __init__(self, - logs: List[Log], - nextPageToken: str = None, - syncStatus: SyncStatus = None): + def __init__( + self, logs: List[Log], nextPageToken: str = None, syncStatus: SyncStatus = None + ): self.logs = logs self.nextPageToken = nextPageToken self.syncStatus = syncStatus @@ -381,26 +405,36 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - logs=data.get('logs'), - nextPageToken=data.get('nextPageToken'), - syncStatus=data.get('syncStatus'), + logs=data.get("logs"), + nextPageToken=data.get("nextPageToken"), + syncStatus=data.get("syncStatus"), ) class GetLogsRequest: - def __init__(self, - blockchain: Blockchain | List[Blockchain], - fromBlock: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - toBlock: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - fromTimestamp: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - toTimestamp: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - address: List[str] = None, - topics: List[str | List[str]] = None, - pageToken: str = None, - pageSize: float = None, - descOrder: bool = None, - decodeLogs: bool = None, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain | List[Blockchain], + fromBlock: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + toBlock: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + fromTimestamp: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + toTimestamp: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + address: List[str] = None, + topics: List[str | List[str]] = None, + pageToken: str = None, + pageSize: float = None, + descOrder: bool = None, + decodeLogs: bool = None, + syncCheck: bool = None, + ): self.blockchain = blockchain self.fromBlock = fromBlock self.toBlock = toBlock @@ -418,35 +452,40 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'fromBlock': self.fromBlock, - 'toBlock': self.toBlock, - 'fromTimestamp': self.fromTimestamp, - 'toTimestamp': self.toTimestamp, - 'address': self.address, - 'topics': self.topics, - 'pageToken': self.pageToken, - 'pageSize': self.pageSize, - 'descOrder': self.descOrder, - 'decodeLogs': self.decodeLogs, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "fromBlock": self.fromBlock, + "toBlock": self.toBlock, + "fromTimestamp": self.fromTimestamp, + "toTimestamp": self.toTimestamp, + "address": self.address, + "topics": self.topics, + "pageToken": self.pageToken, + "pageSize": self.pageSize, + "descOrder": self.descOrder, + "decodeLogs": self.decodeLogs, + "syncCheck": self.syncCheck, } class BlockchainStats: - def __init__(self, - blockTimeMs: float, - blockchain: str, - latestBlockNumber: float, - nativeCoinUsdPrice: str, - totalEventsCount: float, - totalTransactionsCount: float): + def __init__( + self, + blockTimeMs: float, + blockchain: str, + latestBlockNumber: float, + nativeCoinUsdPrice: str, + totalEventsCount: float, + totalTransactionsCount: float, + ): self.blockTimeMs = blockTimeMs self.blockchain = blockchain self.latestBlockNumber = latestBlockNumber @@ -456,24 +495,22 @@ def __init__(self, class GetBlockchainStatsReply: - def __init__(self, - stats: List[BlockchainStats], - syncStatus: SyncStatus = None): + def __init__(self, stats: List[BlockchainStats], syncStatus: SyncStatus = None): self.stats = stats self.syncStatus = syncStatus @classmethod def from_dict(cls, **data): return cls( - stats=data.get('stats'), - syncStatus=data.get('syncStatus'), + stats=data.get("stats"), + syncStatus=data.get("syncStatus"), ) class GetBlockchainStatsRequest: - def __init__(self, - blockchain: Blockchain | List[Blockchain] = None, - syncCheck: bool = None): + def __init__( + self, blockchain: Blockchain | List[Blockchain] = None, syncCheck: bool = None + ): self.blockchain = blockchain self.syncCheck = syncCheck @@ -481,60 +518,61 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "syncCheck": self.syncCheck, } class GetInteractionsReply: - def __init__(self, - blockchains: List[str], - syncStatus: SyncStatus = None): + def __init__(self, blockchains: List[str], syncStatus: SyncStatus = None): self.blockchains = blockchains self.syncStatus = syncStatus @classmethod def from_dict(cls, **data): return cls( - blockchains=data.get('blockchains'), - syncStatus=data.get('syncStatus'), + blockchains=data.get("blockchains"), + syncStatus=data.get("syncStatus"), ) class GetInteractionsRequest: - def __init__(self, - address: str, - syncCheck: bool = None): + def __init__(self, address: str, syncCheck: bool = None): self.address = address self.syncCheck = syncCheck def to_dict(self): return { - 'address': self.address, - 'syncCheck': self.syncCheck, + "address": self.address, + "syncCheck": self.syncCheck, } class Balance: - def __init__(self, - balance: str, - balanceRawInteger: str, - balanceUsd: str, - blockchain: Blockchain, - holderAddress: str, - thumbnail: str, - tokenDecimals: float, - tokenName: str, - tokenPrice: str, - tokenSymbol: str, - tokenType: str, - contractAddress: str = None): + def __init__( + self, + balance: str, + balanceRawInteger: str, + balanceUsd: str, + blockchain: Blockchain, + holderAddress: str, + thumbnail: str, + tokenDecimals: float, + tokenName: str, + tokenPrice: str, + tokenSymbol: str, + tokenType: str, + contractAddress: str = None, + ): self.balance = balance self.balanceRawInteger = balanceRawInteger self.balanceUsd = balanceUsd @@ -550,12 +588,14 @@ def __init__(self, class GetAccountBalanceReply: - def __init__(self, - assets: List[Balance], - totalBalanceUsd: str, - totalCount: float, - nextPageToken: str = None, - syncStatus: SyncStatus = None): + def __init__( + self, + assets: List[Balance], + totalBalanceUsd: str, + totalCount: float, + nextPageToken: str = None, + syncStatus: SyncStatus = None, + ): self.assets = assets self.totalBalanceUsd = totalBalanceUsd self.totalCount = totalCount @@ -565,23 +605,25 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - assets=data.get('assets'), - totalBalanceUsd=data.get('totalBalanceUsd'), - totalCount=data.get('totalCount'), - nextPageToken=data.get('nextPageToken'), - syncStatus=data.get('syncStatus'), + assets=data.get("assets"), + totalBalanceUsd=data.get("totalBalanceUsd"), + totalCount=data.get("totalCount"), + nextPageToken=data.get("nextPageToken"), + syncStatus=data.get("syncStatus"), ) class GetAccountBalanceRequest: - def __init__(self, - walletAddress: str, - blockchain: Blockchain | List[Blockchain] = None, - onlyWhitelisted: bool = None, - nativeFirst: bool = None, - pageToken: str = None, - pageSize: float = None, - syncCheck: bool = None): + def __init__( + self, + walletAddress: str, + blockchain: Blockchain | List[Blockchain] = None, + onlyWhitelisted: bool = None, + nativeFirst: bool = None, + pageToken: str = None, + pageSize: float = None, + syncCheck: bool = None, + ): self.walletAddress = walletAddress self.blockchain = blockchain self.onlyWhitelisted = onlyWhitelisted @@ -594,28 +636,33 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'walletAddress': self.walletAddress, - 'blockchain': blockchain_value, - 'onlyWhitelisted': self.onlyWhitelisted, - 'nativeFirst': self.nativeFirst, - 'pageToken': self.pageToken, - 'pageSize': self.pageSize, - 'syncCheck': self.syncCheck, + "walletAddress": self.walletAddress, + "blockchain": blockchain_value, + "onlyWhitelisted": self.onlyWhitelisted, + "nativeFirst": self.nativeFirst, + "pageToken": self.pageToken, + "pageSize": self.pageSize, + "syncCheck": self.syncCheck, } class GetTokenPriceReply: - def __init__(self, - blockchain: Blockchain, - usdPrice: str, - contractAddress: str = None, - syncStatus: SyncStatus = None): + def __init__( + self, + blockchain: Blockchain, + usdPrice: str, + contractAddress: str = None, + syncStatus: SyncStatus = None, + ): self.blockchain = blockchain self.usdPrice = usdPrice self.contractAddress = contractAddress @@ -624,18 +671,20 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - blockchain=data.get('blockchain'), - usdPrice=data.get('usdPrice'), - contractAddress=data.get('contractAddress'), - syncStatus=data.get('syncStatus'), + blockchain=data.get("blockchain"), + usdPrice=data.get("usdPrice"), + contractAddress=data.get("contractAddress"), + syncStatus=data.get("syncStatus"), ) class GetTokenPriceRequest: - def __init__(self, - blockchain: Blockchain, - contractAddress: str = None, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain, + contractAddress: str = None, + syncCheck: bool = None, + ): self.blockchain = blockchain self.contractAddress = contractAddress self.syncCheck = syncCheck @@ -644,37 +693,39 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'contractAddress': self.contractAddress, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "contractAddress": self.contractAddress, + "syncCheck": self.syncCheck, } class HolderBalance: - def __init__(self, - balance: str, - balanceRawInteger: str, - holderAddress: str): + def __init__(self, balance: str, balanceRawInteger: str, holderAddress: str): self.balance = balance self.balanceRawInteger = balanceRawInteger self.holderAddress = holderAddress class GetTokenHoldersReply: - def __init__(self, - blockchain: Blockchain, - contractAddress: str, - holders: List[HolderBalance], - holdersCount: float, - nextPageToken: str, - tokenDecimals: float, - syncStatus: SyncStatus = None): + def __init__( + self, + blockchain: Blockchain, + contractAddress: str, + holders: List[HolderBalance], + holdersCount: float, + nextPageToken: str, + tokenDecimals: float, + syncStatus: SyncStatus = None, + ): self.blockchain = blockchain self.contractAddress = contractAddress self.holders = holders @@ -686,23 +737,25 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - blockchain=data.get('blockchain'), - contractAddress=data.get('contractAddress'), - holders=data.get('holders'), - holdersCount=data.get('holdersCount'), - nextPageToken=data.get('nextPageToken'), - tokenDecimals=data.get('tokenDecimals'), - syncStatus=data.get('syncStatus'), + blockchain=data.get("blockchain"), + contractAddress=data.get("contractAddress"), + holders=data.get("holders"), + holdersCount=data.get("holdersCount"), + nextPageToken=data.get("nextPageToken"), + tokenDecimals=data.get("tokenDecimals"), + syncStatus=data.get("syncStatus"), ) class GetTokenHoldersRequest: - def __init__(self, - blockchain: Blockchain, - contractAddress: str, - pageToken: str = None, - pageSize: float = None, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain, + contractAddress: str, + pageToken: str = None, + pageSize: float = None, + syncCheck: bool = None, + ): self.blockchain = blockchain self.contractAddress = contractAddress self.pageToken = pageToken @@ -713,26 +766,31 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'contractAddress': self.contractAddress, - 'pageToken': self.pageToken, - 'pageSize': self.pageSize, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "contractAddress": self.contractAddress, + "pageToken": self.pageToken, + "pageSize": self.pageSize, + "syncCheck": self.syncCheck, } class DailyHolderCount: - def __init__(self, - holderCount: float, - lastUpdatedAt: str, - totalAmount: str, - totalAmountRawInteger: str): + def __init__( + self, + holderCount: float, + lastUpdatedAt: str, + totalAmount: str, + totalAmountRawInteger: str, + ): self.holderCount = holderCount self.lastUpdatedAt = lastUpdatedAt self.totalAmount = totalAmount @@ -740,14 +798,16 @@ def __init__(self, class GetTokenHoldersCountReply: - def __init__(self, - blockchain: Blockchain, - contractAddress: str, - holderCountHistory: List[DailyHolderCount], - latestHoldersCount: float, - nextPageToken: str, - tokenDecimals: float, - syncStatus: SyncStatus = None): + def __init__( + self, + blockchain: Blockchain, + contractAddress: str, + holderCountHistory: List[DailyHolderCount], + latestHoldersCount: float, + nextPageToken: str, + tokenDecimals: float, + syncStatus: SyncStatus = None, + ): self.blockchain = blockchain self.contractAddress = contractAddress self.holderCountHistory = holderCountHistory @@ -759,23 +819,25 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - blockchain=data.get('blockchain'), - contractAddress=data.get('contractAddress'), - holderCountHistory=data.get('holderCountHistory'), - latestHoldersCount=data.get('latestHoldersCount'), - nextPageToken=data.get('nextPageToken'), - tokenDecimals=data.get('tokenDecimals'), - syncStatus=data.get('syncStatus'), + blockchain=data.get("blockchain"), + contractAddress=data.get("contractAddress"), + holderCountHistory=data.get("holderCountHistory"), + latestHoldersCount=data.get("latestHoldersCount"), + nextPageToken=data.get("nextPageToken"), + tokenDecimals=data.get("tokenDecimals"), + syncStatus=data.get("syncStatus"), ) class GetTokenHoldersCountRequest: - def __init__(self, - blockchain: Blockchain, - contractAddress: str, - pageToken: str = None, - pageSize: float = None, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain, + contractAddress: str, + pageToken: str = None, + pageSize: float = None, + syncCheck: bool = None, + ): self.blockchain = blockchain self.contractAddress = contractAddress self.pageToken = pageToken @@ -786,28 +848,33 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'contractAddress': self.contractAddress, - 'pageToken': self.pageToken, - 'pageSize': self.pageSize, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "contractAddress": self.contractAddress, + "pageToken": self.pageToken, + "pageSize": self.pageSize, + "syncCheck": self.syncCheck, } class CurrencyDetailsExtended: - def __init__(self, - blockchain: Blockchain, - decimals: float, - name: str, - symbol: str, - thumbnail: str, - address: str = None): + def __init__( + self, + blockchain: Blockchain, + decimals: float, + name: str, + symbol: str, + thumbnail: str, + address: str = None, + ): self.blockchain = blockchain self.decimals = decimals self.name = name @@ -817,24 +884,22 @@ def __init__(self, class GetCurrenciesReply: - def __init__(self, - currencies: List[CurrencyDetailsExtended], - syncStatus: SyncStatus = None): + def __init__( + self, currencies: List[CurrencyDetailsExtended], syncStatus: SyncStatus = None + ): self.currencies = currencies self.syncStatus = syncStatus @classmethod def from_dict(cls, **data): return cls( - currencies=data.get('currencies'), - syncStatus=data.get('syncStatus'), + currencies=data.get("currencies"), + syncStatus=data.get("syncStatus"), ) class GetCurrenciesRequest: - def __init__(self, - blockchain: Blockchain, - syncCheck: bool = None): + def __init__(self, blockchain: Blockchain, syncCheck: bool = None): self.blockchain = blockchain self.syncCheck = syncCheck @@ -842,33 +907,38 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "syncCheck": self.syncCheck, } class TokenTransfer: - def __init__(self, - blockHeight: float, - blockchain: str, - thumbnail: str, - timestamp: float, - tokenDecimals: float, - tokenName: str, - tokenSymbol: str, - transactionHash: str, - value: str, - valueRawInteger: str, - fromAddress: str = None, - contractAddress: str = None, - toAddress: str = None, - direction: str = None): + def __init__( + self, + blockHeight: float, + blockchain: str, + thumbnail: str, + timestamp: float, + tokenDecimals: float, + tokenName: str, + tokenSymbol: str, + transactionHash: str, + value: str, + valueRawInteger: str, + fromAddress: str = None, + contractAddress: str = None, + toAddress: str = None, + direction: str = None, + ): self.blockHeight = blockHeight self.blockchain = blockchain self.thumbnail = thumbnail @@ -886,10 +956,12 @@ def __init__(self, class GetTokenTransfersReply: - def __init__(self, - transfers: List[TokenTransfer], - nextPageToken: str = None, - syncStatus: SyncStatus = None): + def __init__( + self, + transfers: List[TokenTransfer], + nextPageToken: str = None, + syncStatus: SyncStatus = None, + ): self.transfers = transfers self.nextPageToken = nextPageToken self.syncStatus = syncStatus @@ -897,24 +969,34 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - transfers=data.get('transfers'), - nextPageToken=data.get('nextPageToken'), - syncStatus=data.get('syncStatus'), + transfers=data.get("transfers"), + nextPageToken=data.get("nextPageToken"), + syncStatus=data.get("syncStatus"), ) class GetTransfersRequest: - def __init__(self, - blockchain: Blockchain | List[Blockchain], - fromBlock: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - toBlock: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - fromTimestamp: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - toTimestamp: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - address: List[str] = None, - pageToken: str = None, - pageSize: float = None, - descOrder: bool = None, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain | List[Blockchain], + fromBlock: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + toBlock: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + fromTimestamp: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + toTimestamp: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + address: List[str] = None, + pageToken: str = None, + pageSize: float = None, + descOrder: bool = None, + syncCheck: bool = None, + ): self.blockchain = blockchain self.fromBlock = fromBlock self.toBlock = toBlock @@ -930,46 +1012,51 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'fromBlock': self.fromBlock, - 'toBlock': self.toBlock, - 'fromTimestamp': self.fromTimestamp, - 'toTimestamp': self.toTimestamp, - 'address': self.address, - 'pageToken': self.pageToken, - 'pageSize': self.pageSize, - 'descOrder': self.descOrder, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "fromBlock": self.fromBlock, + "toBlock": self.toBlock, + "fromTimestamp": self.fromTimestamp, + "toTimestamp": self.toTimestamp, + "address": self.address, + "pageToken": self.pageToken, + "pageSize": self.pageSize, + "descOrder": self.descOrder, + "syncCheck": self.syncCheck, } class Trait: - def __init__(self, - trait_type: str, - value: str): + def __init__(self, trait_type: str, value: str): self.trait_type = trait_type self.value = value class Nft: - def __init__(self, - blockchain: Blockchain, - collectionName: str, - contractAddress: str, - contractType: Literal[Literal['ERC721'], Literal['ERC1155'], Literal['UNDEFINED']], - imageUrl: str, - name: str, - symbol: str, - tokenId: str, - tokenUrl: str, - quantity: str = None, - traits: List[Trait] = None): + def __init__( + self, + blockchain: Blockchain, + collectionName: str, + contractAddress: str, + contractType: Literal[ + Literal["ERC721"], Literal["ERC1155"], Literal["UNDEFINED"] + ], + imageUrl: str, + name: str, + symbol: str, + tokenId: str, + tokenUrl: str, + quantity: str = None, + traits: List[Trait] = None, + ): self.blockchain = blockchain self.collectionName = collectionName self.contractAddress = contractAddress @@ -984,11 +1071,13 @@ def __init__(self, class GetNFTsByOwnerReply: - def __init__(self, - assets: List[Nft], - nextPageToken: str, - owner: str, - syncStatus: SyncStatus = None): + def __init__( + self, + assets: List[Nft], + nextPageToken: str, + owner: str, + syncStatus: SyncStatus = None, + ): self.assets = assets self.nextPageToken = nextPageToken self.owner = owner @@ -997,21 +1086,23 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - assets=data.get('assets'), - nextPageToken=data.get('nextPageToken'), - owner=data.get('owner'), - syncStatus=data.get('syncStatus'), + assets=data.get("assets"), + nextPageToken=data.get("nextPageToken"), + owner=data.get("owner"), + syncStatus=data.get("syncStatus"), ) class GetNFTsByOwnerRequest: - def __init__(self, - walletAddress: str, - blockchain: Blockchain | List[Blockchain] = None, - filter: List[Dict[str, List[str]]] = None, - pageToken: str = None, - pageSize: float = None, - syncCheck: bool = None): + def __init__( + self, + walletAddress: str, + blockchain: Blockchain | List[Blockchain] = None, + filter: List[Dict[str, List[str]]] = None, + pageToken: str = None, + pageSize: float = None, + syncCheck: bool = None, + ): self.walletAddress = walletAddress self.blockchain = blockchain self.filter = filter @@ -1023,29 +1114,36 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'walletAddress': self.walletAddress, - 'blockchain': blockchain_value, - 'filter': self.filter, - 'pageToken': self.pageToken, - 'pageSize': self.pageSize, - 'syncCheck': self.syncCheck, + "walletAddress": self.walletAddress, + "blockchain": blockchain_value, + "filter": self.filter, + "pageToken": self.pageToken, + "pageSize": self.pageSize, + "syncCheck": self.syncCheck, } class NftAttributes: - def __init__(self, - contractType: Literal[Literal['ERC721'], Literal['ERC1155'], Literal['UNDEFINED']], - description: str, - imageUrl: str, - name: str, - tokenUrl: str, - traits: List[Trait] = None): + def __init__( + self, + contractType: Literal[ + Literal["ERC721"], Literal["ERC1155"], Literal["UNDEFINED"] + ], + description: str, + imageUrl: str, + name: str, + tokenUrl: str, + traits: List[Trait] = None, + ): self.contractType = contractType self.description = description self.imageUrl = imageUrl @@ -1055,13 +1153,17 @@ def __init__(self, class NftMetadata: - def __init__(self, - blockchain: Blockchain, - collectionName: str, - collectionSymbol: str, - contractAddress: str, - contractType: Literal[Literal['ERC721'], Literal['ERC1155'], Literal['UNDEFINED']], - tokenId: str): + def __init__( + self, + blockchain: Blockchain, + collectionName: str, + collectionSymbol: str, + contractAddress: str, + contractType: Literal[ + Literal["ERC721"], Literal["ERC1155"], Literal["UNDEFINED"] + ], + tokenId: str, + ): self.blockchain = blockchain self.collectionName = collectionName self.collectionSymbol = collectionSymbol @@ -1071,10 +1173,12 @@ def __init__(self, class GetNFTMetadataReply: - def __init__(self, - metadata: NftMetadata = None, - attributes: NftAttributes = None, - syncStatus: SyncStatus = None): + def __init__( + self, + metadata: NftMetadata = None, + attributes: NftAttributes = None, + syncStatus: SyncStatus = None, + ): self.metadata = metadata self.attributes = attributes self.syncStatus = syncStatus @@ -1082,19 +1186,21 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - metadata=data.get('metadata'), - attributes=data.get('attributes'), - syncStatus=data.get('syncStatus'), + metadata=data.get("metadata"), + attributes=data.get("attributes"), + syncStatus=data.get("syncStatus"), ) class GetNFTMetadataRequest: - def __init__(self, - blockchain: Blockchain, - contractAddress: str, - forceFetch: bool, - tokenId: str, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain, + contractAddress: str, + forceFetch: bool, + tokenId: str, + syncCheck: bool = None, + ): self.blockchain = blockchain self.contractAddress = contractAddress self.forceFetch = forceFetch @@ -1105,25 +1211,27 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'contractAddress': self.contractAddress, - 'forceFetch': self.forceFetch, - 'tokenId': self.tokenId, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "contractAddress": self.contractAddress, + "forceFetch": self.forceFetch, + "tokenId": self.tokenId, + "syncCheck": self.syncCheck, } class GetNFTHoldersReply: - def __init__(self, - holders: List[str], - nextPageToken: str, - syncStatus: SyncStatus = None): + def __init__( + self, holders: List[str], nextPageToken: str, syncStatus: SyncStatus = None + ): self.holders = holders self.nextPageToken = nextPageToken self.syncStatus = syncStatus @@ -1131,19 +1239,21 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - holders=data.get('holders'), - nextPageToken=data.get('nextPageToken'), - syncStatus=data.get('syncStatus'), + holders=data.get("holders"), + nextPageToken=data.get("nextPageToken"), + syncStatus=data.get("syncStatus"), ) class GetNFTHoldersRequest: - def __init__(self, - blockchain: Blockchain, - contractAddress: str, - pageToken: str = None, - pageSize: float = None, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain, + contractAddress: str, + pageToken: str = None, + pageSize: float = None, + syncCheck: bool = None, + ): self.blockchain = blockchain self.contractAddress = contractAddress self.pageToken = pageToken @@ -1154,36 +1264,41 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'contractAddress': self.contractAddress, - 'pageToken': self.pageToken, - 'pageSize': self.pageSize, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "contractAddress": self.contractAddress, + "pageToken": self.pageToken, + "pageSize": self.pageSize, + "syncCheck": self.syncCheck, } class NftTransfer: - def __init__(self, - blockHeight: float, - blockchain: Blockchain, - collectionName: str, - collectionSymbol: str, - fromAddress: str, - imageUrl: str, - name: str, - timestamp: float, - toAddress: str, - transactionHash: str, - type: Literal[Literal['ERC721'], Literal['ERC1155'], Literal['UNDEFINED']], - value: str, - tokenId: str = None, - contractAddress: str = None): + def __init__( + self, + blockHeight: float, + blockchain: Blockchain, + collectionName: str, + collectionSymbol: str, + fromAddress: str, + imageUrl: str, + name: str, + timestamp: float, + toAddress: str, + transactionHash: str, + type: Literal[Literal["ERC721"], Literal["ERC1155"], Literal["UNDEFINED"]], + value: str, + tokenId: str = None, + contractAddress: str = None, + ): self.blockHeight = blockHeight self.blockchain = blockchain self.collectionName = collectionName @@ -1201,10 +1316,12 @@ def __init__(self, class GetNftTransfersReply: - def __init__(self, - transfers: List[NftTransfer], - nextPageToken: str = None, - syncStatus: SyncStatus = None): + def __init__( + self, + transfers: List[NftTransfer], + nextPageToken: str = None, + syncStatus: SyncStatus = None, + ): self.transfers = transfers self.nextPageToken = nextPageToken self.syncStatus = syncStatus @@ -1212,18 +1329,20 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - transfers=data.get('transfers'), - nextPageToken=data.get('nextPageToken'), - syncStatus=data.get('syncStatus'), + transfers=data.get("transfers"), + nextPageToken=data.get("nextPageToken"), + syncStatus=data.get("syncStatus"), ) class GetTokenAllowancesRequest: - def __init__(self, - blockchain: Blockchain | List[Blockchain], - walletAddress: str, - spenderAddress: str = None, - contractAddress: str = None): + def __init__( + self, + blockchain: Blockchain | List[Blockchain], + walletAddress: str, + spenderAddress: str = None, + contractAddress: str = None, + ): self.blockchain = blockchain self.walletAddress = walletAddress self.spenderAddress = spenderAddress @@ -1233,34 +1352,39 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'walletAddress': self.walletAddress, - 'spenderAddress': self.spenderAddress, - 'contractAddress': self.contractAddress, + "blockchain": blockchain_value, + "walletAddress": self.walletAddress, + "spenderAddress": self.spenderAddress, + "contractAddress": self.contractAddress, } class ERC20TokenAllowance: - def __init__(self, - blockHeight: float, - thumbnail: str, - timestamp: float, - value: str = None, - tokenDecimals: float = None, - walletAddress: str = None, - contractAddress: str = None, - transactionHash: str = None, - blockchain: str = None, - tokenName: str = None, - tokenSymbol: str = None, - spenderAddress: str = None, - rawLog: Log = None): + def __init__( + self, + blockHeight: float, + thumbnail: str, + timestamp: float, + value: str = None, + tokenDecimals: float = None, + walletAddress: str = None, + contractAddress: str = None, + transactionHash: str = None, + blockchain: str = None, + tokenName: str = None, + tokenSymbol: str = None, + spenderAddress: str = None, + rawLog: Log = None, + ): self.blockHeight = blockHeight self.thumbnail = thumbnail self.timestamp = timestamp @@ -1277,26 +1401,31 @@ def __init__(self, class GetTokenAllowancesReply: - def __init__(self, - allowances: List[ERC20TokenAllowance]): + def __init__(self, allowances: List[ERC20TokenAllowance]): self.allowances = allowances @classmethod def from_dict(cls, **data): return cls( - allowances=data.get('allowances'), + allowances=data.get("allowances"), ) class GetTokenPriceHistoryRequest: - def __init__(self, - blockchain: Blockchain, - contractAddress: str, - fromTimestamp: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - toTimestamp: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - interval: float = None, - limit: float = None, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain, + contractAddress: str, + fromTimestamp: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + toTimestamp: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + interval: float = None, + limit: float = None, + syncCheck: bool = None, + ): self.blockchain = blockchain self.contractAddress = contractAddress self.fromTimestamp = fromTimestamp @@ -1309,52 +1438,52 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'contractAddress': self.contractAddress, - 'fromTimestamp': self.fromTimestamp, - 'toTimestamp': self.toTimestamp, - 'interval': self.interval, - 'limit': self.limit, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "contractAddress": self.contractAddress, + "fromTimestamp": self.fromTimestamp, + "toTimestamp": self.toTimestamp, + "interval": self.interval, + "limit": self.limit, + "syncCheck": self.syncCheck, } class Quote: - def __init__(self, - blockHeight: float, - timestamp: float, - usdPrice: str): + def __init__(self, blockHeight: float, timestamp: float, usdPrice: str): self.blockHeight = blockHeight self.timestamp = timestamp self.usdPrice = usdPrice class GetTokenPriceHistoryReply: - def __init__(self, - quotes: List[Quote], - syncStatus: SyncStatus = None): + def __init__(self, quotes: List[Quote], syncStatus: SyncStatus = None): self.quotes = quotes self.syncStatus = syncStatus @classmethod def from_dict(cls, **data): return cls( - quotes=data.get('quotes'), - syncStatus=data.get('syncStatus'), + quotes=data.get("quotes"), + syncStatus=data.get("syncStatus"), ) class ExplainTokenPriceRequest: - def __init__(self, - blockHeight: float | Literal[Literal['latest']] | Literal[Literal['earliest']], - blockchain: Blockchain, - tokenAddress: str): + def __init__( + self, + blockHeight: float | Literal[Literal["latest"]] | Literal[Literal["earliest"]], + blockchain: Blockchain, + tokenAddress: str, + ): self.blockHeight = blockHeight self.blockchain = blockchain self.tokenAddress = tokenAddress @@ -1363,35 +1492,38 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockHeight': self.blockHeight, - 'blockchain': blockchain_value, - 'tokenAddress': self.tokenAddress, + "blockHeight": self.blockHeight, + "blockchain": blockchain_value, + "tokenAddress": self.tokenAddress, } class PriceEstimate: - def __init__(self, - price: str, - strategy: str): + def __init__(self, price: str, strategy: str): self.price = price self.strategy = strategy class ExplainTokenPriceLPDetails: - def __init__(self, - address: str, - lastUpdatedBlock: float, - price: str, - reserve0: str, - reserve1: str, - token0: str, - token1: str): + def __init__( + self, + address: str, + lastUpdatedBlock: float, + price: str, + reserve0: str, + reserve1: str, + token0: str, + token1: str, + ): self.address = address self.lastUpdatedBlock = lastUpdatedBlock self.price = price @@ -1402,11 +1534,7 @@ def __init__(self, class ExplainTokenPriceTokenDetails: - def __init__(self, - contractAddress: str, - decimals: float, - name: str, - symbol: str): + def __init__(self, contractAddress: str, decimals: float, name: str, symbol: str): self.contractAddress = contractAddress self.decimals = decimals self.name = name @@ -1414,11 +1542,13 @@ def __init__(self, class ExplainTokenPriceSinglePair: - def __init__(self, - liquidity_pools: List[ExplainTokenPriceLPDetails], - priceEstimates: List[PriceEstimate], - token0: ExplainTokenPriceTokenDetails, - token1: ExplainTokenPriceTokenDetails): + def __init__( + self, + liquidity_pools: List[ExplainTokenPriceLPDetails], + priceEstimates: List[PriceEstimate], + token0: ExplainTokenPriceTokenDetails, + token1: ExplainTokenPriceTokenDetails, + ): self.liquidity_pools = liquidity_pools self.priceEstimates = priceEstimates self.token0 = token0 @@ -1426,11 +1556,13 @@ def __init__(self, class ExplainTokenPriceReply: - def __init__(self, - blockchain: str, - pairs: List[ExplainTokenPriceSinglePair], - priceEstimates: List[PriceEstimate], - tokenAddress: str): + def __init__( + self, + blockchain: str, + pairs: List[ExplainTokenPriceSinglePair], + priceEstimates: List[PriceEstimate], + tokenAddress: str, + ): self.blockchain = blockchain self.pairs = pairs self.priceEstimates = priceEstimates @@ -1439,19 +1571,21 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - blockchain=data.get('blockchain'), - pairs=data.get('pairs'), - priceEstimates=data.get('priceEstimates'), - tokenAddress=data.get('tokenAddress'), + blockchain=data.get("blockchain"), + pairs=data.get("pairs"), + priceEstimates=data.get("priceEstimates"), + tokenAddress=data.get("tokenAddress"), ) class GetInternalTransactionsByParentHashRequest: - def __init__(self, - blockchain: Blockchain, - onlyWithValue: bool, - parentTransactionHash: str, - syncCheck: bool = None): + def __init__( + self, + blockchain: Blockchain, + onlyWithValue: bool, + parentTransactionHash: str, + syncCheck: bool = None, + ): self.blockchain = blockchain self.onlyWithValue = onlyWithValue self.parentTransactionHash = parentTransactionHash @@ -1461,25 +1595,30 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockchain': blockchain_value, - 'onlyWithValue': self.onlyWithValue, - 'parentTransactionHash': self.parentTransactionHash, - 'syncCheck': self.syncCheck, + "blockchain": blockchain_value, + "onlyWithValue": self.onlyWithValue, + "parentTransactionHash": self.parentTransactionHash, + "syncCheck": self.syncCheck, } class GetInternalTransactionsByBlockNumberRequest: - def __init__(self, - blockNumber: float, - blockchain: Blockchain, - onlyWithValue: bool, - syncCheck: bool = None): + def __init__( + self, + blockNumber: float, + blockchain: Blockchain, + onlyWithValue: bool, + syncCheck: bool = None, + ): self.blockNumber = blockNumber self.blockchain = blockchain self.onlyWithValue = onlyWithValue @@ -1489,39 +1628,44 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'blockNumber': self.blockNumber, - 'blockchain': blockchain_value, - 'onlyWithValue': self.onlyWithValue, - 'syncCheck': self.syncCheck, + "blockNumber": self.blockNumber, + "blockchain": blockchain_value, + "onlyWithValue": self.onlyWithValue, + "syncCheck": self.syncCheck, } class InternalTransaction: - def __init__(self, - blockHash: str, - blockHeight: float, - blockchain: Blockchain, - callType: str, - fromAddress: str, - gas: float, - gasUsed: float, - input: str, - output: str, - timestamp: str, - toAddress: str, - transactionHash: str, - transactionIndex: float, - value: str, - callPath: str = None, - callStack: List[float] = None, - error: str = None, - contractAddress: str = None): + def __init__( + self, + blockHash: str, + blockHeight: float, + blockchain: Blockchain, + callType: str, + fromAddress: str, + gas: float, + gasUsed: float, + input: str, + output: str, + timestamp: str, + toAddress: str, + transactionHash: str, + transactionIndex: float, + value: str, + callPath: str = None, + callStack: List[float] = None, + error: str = None, + contractAddress: str = None, + ): self.blockHash = blockHash self.blockHeight = blockHeight self.blockchain = blockchain @@ -1543,30 +1687,34 @@ def __init__(self, class GetInternalTransactionsReply: - def __init__(self, - internalTransactions: List[InternalTransaction], - nextPageToken: str = None): + def __init__( + self, internalTransactions: List[InternalTransaction], nextPageToken: str = None + ): self.internalTransactions = internalTransactions self.nextPageToken = nextPageToken @classmethod def from_dict(cls, **data): return cls( - internalTransactions=data.get('internalTransactions'), - nextPageToken=data.get('nextPageToken'), + internalTransactions=data.get("internalTransactions"), + nextPageToken=data.get("nextPageToken"), ) class GetAccountBalanceHistoricalRequest: - def __init__(self, - walletAddress: str, - blockchain: Blockchain | List[Blockchain] = None, - onlyWhitelisted: bool = None, - nativeFirst: bool = None, - pageToken: str = None, - pageSize: float = None, - blockHeight: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None, - syncCheck: bool = None): + def __init__( + self, + walletAddress: str, + blockchain: Blockchain | List[Blockchain] = None, + onlyWhitelisted: bool = None, + nativeFirst: bool = None, + pageToken: str = None, + pageSize: float = None, + blockHeight: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + syncCheck: bool = None, + ): self.walletAddress = walletAddress self.blockchain = blockchain self.onlyWhitelisted = onlyWhitelisted @@ -1580,31 +1728,38 @@ def to_dict(self): if isinstance(self.blockchain, str): blockchain_value = self.blockchain elif isinstance(self.blockchain, list): - blockchain_value = [block.value if isinstance(block, Blockchain) else block for block in self.blockchain] + blockchain_value = [ + block.value if isinstance(block, Blockchain) else block + for block in self.blockchain + ] elif self.blockchain is not None: blockchain_value = self.blockchain.value else: blockchain_value = None return { - 'walletAddress': self.walletAddress, - 'blockchain': blockchain_value, - 'onlyWhitelisted': self.onlyWhitelisted, - 'nativeFirst': self.nativeFirst, - 'pageToken': self.pageToken, - 'pageSize': self.pageSize, - 'blockHeight': self.blockHeight, - 'syncCheck': self.syncCheck, + "walletAddress": self.walletAddress, + "blockchain": blockchain_value, + "onlyWhitelisted": self.onlyWhitelisted, + "nativeFirst": self.nativeFirst, + "pageToken": self.pageToken, + "pageSize": self.pageSize, + "blockHeight": self.blockHeight, + "syncCheck": self.syncCheck, } class GetAccountBalanceHistoricalReply: - def __init__(self, - assets: List[Balance], - totalBalanceUsd: str, - totalCount: float, - nextPageToken: str = None, - syncStatus: SyncStatus = None, - blockHeight: float | Literal[Literal['latest']] | Literal[Literal['earliest']] = None): + def __init__( + self, + assets: List[Balance], + totalBalanceUsd: str, + totalCount: float, + nextPageToken: str = None, + syncStatus: SyncStatus = None, + blockHeight: float + | Literal[Literal["latest"]] + | Literal[Literal["earliest"]] = None, + ): self.assets = assets self.totalBalanceUsd = totalBalanceUsd self.totalCount = totalCount @@ -1615,32 +1770,32 @@ def __init__(self, @classmethod def from_dict(cls, **data): return cls( - assets=data.get('assets'), - totalBalanceUsd=data.get('totalBalanceUsd'), - totalCount=data.get('totalCount'), - nextPageToken=data.get('nextPageToken'), - syncStatus=data.get('syncStatus'), - blockHeight=data.get('blockHeight'), + assets=data.get("assets"), + totalBalanceUsd=data.get("totalBalanceUsd"), + totalCount=data.get("totalCount"), + nextPageToken=data.get("nextPageToken"), + syncStatus=data.get("syncStatus"), + blockHeight=data.get("blockHeight"), ) class Blockchain(Enum): - Arbitrum = 'arbitrum' - Avalanche = 'avalanche' - Avalanche_fuji = 'avalanche_fuji' - Base = 'base' - Bsc = 'bsc' - Eth = 'eth' - Eth_goerli = 'eth_goerli' - Fantom = 'fantom' - Flare = 'flare' - Gnosis = 'gnosis' - Linea = 'linea' - Optimism = 'optimism' - Optimism_testnet = 'optimism_testnet' - Polygon = 'polygon' - Polygon_mumbai = 'polygon_mumbai' - Polygon_zkevm = 'polygon_zkevm' - Rollux = 'rollux' - Scroll = 'scroll' - Syscoin = 'syscoin' + Arbitrum = "arbitrum" + Avalanche = "avalanche" + Avalanche_fuji = "avalanche_fuji" + Base = "base" + Bsc = "bsc" + Eth = "eth" + Eth_goerli = "eth_goerli" + Fantom = "fantom" + Flare = "flare" + Gnosis = "gnosis" + Linea = "linea" + Optimism = "optimism" + Optimism_testnet = "optimism_testnet" + Polygon = "polygon" + Polygon_mumbai = "polygon_mumbai" + Polygon_zkevm = "polygon_zkevm" + Rollux = "rollux" + Scroll = "scroll" + Syscoin = "syscoin"