Source code for multiversx_sdk.network_providers.interface

from typing import Any, Callable, Optional, Protocol, Union

from multiversx_sdk.core.address import Address
from multiversx_sdk.core.tokens import Token
from multiversx_sdk.core.transaction import Transaction
from multiversx_sdk.core.transaction_on_network import TransactionOnNetwork
from multiversx_sdk.network_providers.resources import (
    AccountOnNetwork, AccountStorage, AccountStorageEntry, AwaitingOptions,
    BlockOnNetwork, FungibleTokenMetadata, GetBlockArguments, NetworkConfig,
    NetworkStatus, TokenAmountOnNetwork, TokensCollectionMetadata,
    TransactionCostResponse)
from multiversx_sdk.smart_contracts.smart_contract_query import (
    SmartContractQuery, SmartContractQueryResponse)


[docs] class INetworkProvider(Protocol):
[docs] def get_network_config(self) -> NetworkConfig: ...
[docs] def get_network_status(self, shard: int) -> NetworkStatus: ...
[docs] def get_block(self, arguments: GetBlockArguments) -> BlockOnNetwork: ...
[docs] def get_latest_block(self, shard: int) -> BlockOnNetwork: ...
[docs] def get_account(self, address: Address) -> AccountOnNetwork: ...
[docs] def get_account_storage(self, address: Address) -> AccountStorage: ...
[docs] def get_account_storage_entry(self, address: Address, entry_key: str) -> AccountStorageEntry: ...
[docs] def await_account_on_condition( self, address: Address, condition: Callable[[AccountOnNetwork], bool], options: Optional[AwaitingOptions]) -> AccountOnNetwork: ...
[docs] def send_transaction(self, transaction: Transaction) -> bytes: ...
[docs] def simulate_transaction(self, transaction: Transaction) -> TransactionOnNetwork: ...
[docs] def estimate_transaction_cost(self, transaction: Transaction) -> TransactionCostResponse: ...
[docs] def send_transactions(self, transactions: list[Transaction]) -> tuple[int, list[bytes]]: ...
[docs] def get_transaction(self, transaction_hash: Union[bytes, str]) -> TransactionOnNetwork: ...
[docs] def await_transaction_completed( self, transaction_hash: Union[bytes, str], options: Optional[AwaitingOptions]) -> TransactionOnNetwork: ...
[docs] def await_transaction_on_condition( self, transaction_hash: Union[bytes, str], condition: Callable[[TransactionOnNetwork], bool], options: Optional[AwaitingOptions]) -> TransactionOnNetwork: ...
[docs] def get_token_of_account(self, address: Address, token: Token) -> TokenAmountOnNetwork: ...
[docs] def get_fungible_tokens_of_account(self, address: Address) -> list[TokenAmountOnNetwork]: ...
[docs] def get_non_fungible_tokens_of_account(self, address: Address) -> list[TokenAmountOnNetwork]: ...
[docs] def get_definition_of_fungible_token(self, token_identifier: str) -> FungibleTokenMetadata: ...
[docs] def get_definition_of_tokens_collection(self, collection_name: str) -> TokensCollectionMetadata: ...
[docs] def query_contract(self, query: SmartContractQuery) -> SmartContractQueryResponse: ...
[docs] def do_get_generic(self, url: str, url_parameters: Optional[dict[str, Any]]) -> Any: ...
[docs] def do_post_generic(self, url: str, data: Any, url_parameters: Optional[dict[str, Any]]) -> Any: ...