multiversx_sdk package

Subpackages

Module contents

class multiversx_sdk.Account(secret_key: UserSecretKey, hrp: str | None = None)[source]

Bases: object

get_nonce_then_increment() int[source]
classmethod new_from_keypair(keypair: KeyPair) Account[source]
classmethod new_from_keystore(file_path: Path, password: str, address_index: int | None = None, hrp: str | None = None) Account[source]
classmethod new_from_mnemonic(mnemonic: str, address_index: int = 0, hrp: str | None = None) Account[source]
classmethod new_from_pem(file_path: Path, index: int = 0, hrp: str | None = None) Account[source]
save_to_keystore(path: Path, password: str = '')[source]

Saves the secret key to a keystore file with kind=secretKey.

save_to_pem(path: Path)[source]
sign(data: bytes) bytes[source]

Signs using the account’s secret key.

sign_message(message: Message) bytes[source]
sign_transaction(transaction: Transaction) bytes[source]
verify(data: bytes, signature: bytes) bool[source]

Verifies the signature using the account’s public key.

class multiversx_sdk.AccountAwaiter(fetcher: IAccountFetcher, polling_interval_in_milliseconds: int | None = None, timeout_interval_in_milliseconds: int | None = None, patience_time_in_milliseconds: int | None = None)[source]

Bases: object

AccountAwaiter allows one to await until a specific event occurs on a given address.

Args:

fetcher (IAccountFetcher): Used to fetch the account of the network. polling_interval_in_milliseconds (Optional[int]): The polling interval, in milliseconds. timeout_interval_in_milliseconds (Optional[int]): The timeout, in milliseconds. patience_time_in_milliseconds (Optional[int]): The patience, an extra time (in milliseconds) to wait, after the account has reached its desired condition.

await_on_condition(address: Address, condition: Callable[[AccountOnNetwork], bool]) AccountOnNetwork[source]

Waits until the condition is satisfied.

class multiversx_sdk.AccountController(chain_id: str)[source]

Bases: object

create_transaction_for_guarding_account(sender: IAccount, nonce: int, relayer: Address | None = None) Transaction[source]
create_transaction_for_saving_key_value(sender: IAccount, nonce: int, key_value_pairs: dict[bytes, bytes], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_setting_guardian(sender: IAccount, nonce: int, guardian_address: Address, service_id: str, relayer: Address | None = None) Transaction[source]
create_transaction_for_unguarding_account(sender: IAccount, nonce: int, guardian: Address, relayer: Address | None = None) Transaction[source]
class multiversx_sdk.AccountOnNetwork(raw: dict[str, Any], address: multiversx_sdk.core.address.Address, nonce: int, balance: int, is_guarded: bool, username: str = '', block_coordinates: multiversx_sdk.network_providers.resources.BlockCoordinates | None = None, contract_code_hash: bytes = b'', contract_code: bytes = b'', contract_developer_reward: int = 0, contract_owner_address: multiversx_sdk.core.address.Address | None = None, is_contract_upgradable: bool = False, is_contract_readable: bool = False, is_contract_payable: bool = False, is_contract_payable_by_contract: bool = False)[source]

Bases: object

address: Address
balance: int
block_coordinates: BlockCoordinates | None = None
contract_code: bytes = b''
contract_code_hash: bytes = b''
contract_developer_reward: int = 0
contract_owner_address: Address | None = None
is_contract_payable: bool = False
is_contract_payable_by_contract: bool = False
is_contract_readable: bool = False
is_contract_upgradable: bool = False
is_guarded: bool
nonce: int
raw: dict[str, Any]
username: str = ''
class multiversx_sdk.AccountStorage(raw: dict[str, Any], entries: list[multiversx_sdk.network_providers.resources.AccountStorageEntry], block_coordinates: multiversx_sdk.network_providers.resources.BlockCoordinates | None = None)[source]

Bases: object

block_coordinates: BlockCoordinates | None = None
entries: list[AccountStorageEntry]
raw: dict[str, Any]
class multiversx_sdk.AccountStorageEntry(raw: dict[str, Any], key: str, value: bytes, block_coordinates: multiversx_sdk.network_providers.resources.BlockCoordinates | None = None)[source]

Bases: object

block_coordinates: BlockCoordinates | None = None
key: str
raw: dict[str, Any]
value: bytes
class multiversx_sdk.AccountTransactionsFactory(config: TransactionsFactoryConfig)[source]

Bases: object

create_transaction_for_guarding_account(sender: Address) Transaction[source]
create_transaction_for_saving_key_value(sender: Address, key_value_pairs: dict[bytes, bytes]) Transaction[source]
create_transaction_for_setting_guardian(sender: Address, guardian_address: Address, service_id: str) Transaction[source]
create_transaction_for_unguarding_account(sender: Address, guardian: Address) Transaction[source]
class multiversx_sdk.AddQuantityOutcome(token_identifier: str, nonce: int, added_quantity: int)[source]

Bases: object

added_quantity: int
nonce: int
token_identifier: str
class multiversx_sdk.Address(pubkey: bytes, hrp: str | None = None)[source]

Bases: object

An Address, as an immutable object.

Creates an address object, given a sequence of bytes and the human readable part(hrp).

Args:

pubkey (bytes): the sequence of bytes

hrp (str): the human readable part

bech32() str[source]

The bech32() method is deprecated. Please us to_bech32() instead

classmethod empty() Address[source]

Creates an empty address object. Generally speaking, this should not be used by client code (internal use only).

classmethod from_bech32(value: str) Address[source]

The from_bech32() method is deprecated. Please use new_from_bech32() instead

classmethod from_hex(value: str, hrp: str) Address[source]

The from_hex() method is deprecated. Please use new_from_hex() instead

get_hrp() str[source]

Returns the human-readable-part of the bech32 address

get_public_key() bytes[source]

Returns the pubkey as bytes

hex() str[source]

The hex() method is deprecated. Please use to_hex() instead

is_empty() bool[source]
is_smart_contract() bool[source]

Returns whether the address is a smart contract address

classmethod new_from_bech32(value: str) Address[source]

Creates an address object from the bech32 representation of an address.

Args:

value (str): the bech32 address representation

classmethod new_from_hex(value: str, hrp: str | None = None) Address[source]

Creates an address object from the hexed sequence of bytes and the human readable part(hrp).

Args:

value (str): the sequence of bytes as a hex string

hrp (str): the human readable part

to_bech32() str[source]

Returns the bech32 representation of the address

to_hex() str[source]

Returns the hex representation of the address (pubkey)

class multiversx_sdk.AddressComputer(number_of_shards: int = 3)[source]

Bases: object

A class for computing contract addresses and getting shard numbers.

Initializes the AddressComputer with the number of shards.

Args:

number_of_shards (int): The number of shards in the network (default: 3).

compute_contract_address(deployer: Address, deployment_nonce: int) Address[source]

Computes the contract address based on the deployer’s address and deployment nonce.

Args:

deployer (Address): The address of the deployer

deployment_nonce (int): The nonce of the deployment

Returns:

Address: The computed contract address as below:

8 bytes of zero + 2 bytes for VM type + 20 bytes of hash(owner) + 2 bytes of shard(owner)

get_shard_of_address(address: Address) int[source]

Returns the shard number of a given address.

Args:

address (Address): The address for which to determine the shard.

Returns:

int: The shard number.

class multiversx_sdk.AddressFactory(hrp: str | None = None)[source]

Bases: object

A factory used to create address objects.

All the addresses created with the factory have the same human readable part

Args:

hrp (str): the human readable part of the address (default: erd)

create_from_bech32(value: str) Address[source]

Creates an address object from the bech32 representation of an address

create_from_hex(value: str) Address[source]

Creates an address object from the hexed sequence of bytes

create_from_public_key(pubkey: bytes) Address[source]

Creates an address object from the sequence of bytes

class multiversx_sdk.ApiNetworkProvider(url: str, address_hrp: str | None = None, config: NetworkProviderConfig | None = None)[source]

Bases: INetworkProvider

await_account_on_condition(address: Address, condition: Callable[[AccountOnNetwork], bool], options: AwaitingOptions | None = None) AccountOnNetwork[source]

Waits until an account satisfies a given condition.

await_transaction_completed(transaction_hash: str | bytes, options: AwaitingOptions | None = None) TransactionOnNetwork[source]

Waits until the transaction is completely processed.

await_transaction_on_condition(transaction_hash: str | bytes, condition: Callable[[TransactionOnNetwork], bool], options: AwaitingOptions | None = None) TransactionOnNetwork[source]

Waits until a transaction satisfies a given condition.

do_get_generic(url: str, url_parameters: dict[str, Any] | None = None) Any[source]

Does a generic GET request against the network(handles API enveloping).

do_post_generic(url: str, data: Any, url_parameters: dict[str, Any] | None = None) Any[source]

Does a generic GET request against the network(handles API enveloping).

estimate_transaction_cost(transaction: Transaction) TransactionCostResponse[source]

Estimates the cost of a transaction.

get_account(address: Address) AccountOnNetwork[source]

Fetches account information for a given address.

get_account_storage(address: Address) AccountStorage[source]

Fetches the storage (key-value pairs) of an account. When decoding the keys, the errors are ignored. Use the raw values if needed.

get_account_storage_entry(address: Address, entry_key: str) AccountStorageEntry[source]

Fetches a specific storage entry of an account.

get_block(arguments: GetBlockArguments) BlockOnNetwork[source]

Fetches a block by hash.

get_definition_of_fungible_token(token_identifier: str) FungibleTokenMetadata[source]

Fetches the definition of a fungible token.

get_definition_of_tokens_collection(collection_name: str) TokensCollectionMetadata[source]

Fetches the definition of a tokens collection.

get_fungible_tokens_of_account(address: Address) list[TokenAmountOnNetwork][source]

Fetches the balances of an account, for all fungible tokens held by the account. Pagination isn’t explicitly handled by a basic network provider, but can be achieved by using do_get_generic.

get_latest_block(shard: int | None = None) BlockOnNetwork[source]

Fetches the latest block of a shard.

get_network_config() NetworkConfig[source]

Fetches the general configuration of the network.

get_network_status(shard: int = 4294967295) NetworkStatus[source]

Fetches the current status of the network.

get_non_fungible_tokens_of_account(address: Address) list[TokenAmountOnNetwork][source]

Fetches the balances of an account, for all non-fungible tokens held by the account. Pagination isn’t explicitly handled by a basic network provider, but can be achieved by using do_get_generic.

get_token_of_account(address: Address, token: Token) TokenAmountOnNetwork[source]

Fetches the balance of an account, for a given token. Able to handle both fungible and non-fungible tokens (NFTs, SFTs, MetaESDTs).

get_transaction(transaction_hash: str | bytes) TransactionOnNetwork[source]

Fetches a transaction that was previously broadcasted (maybe already processed by the network).

query_contract(query: SmartContractQuery) SmartContractQueryResponse[source]
send_transaction(transaction: Transaction) bytes[source]

Broadcasts a transaction and returns its hash.

send_transactions(transactions: list[Transaction]) tuple[int, list[bytes]][source]

Broadcasts multiple transactions and returns a tuple of (number of accepted transactions, list of transaction hashes). In the returned list, the order of transaction hashes corresponds to the order of transactions in the input list. If a transaction is not accepted, its hash is empty in the returned list.

simulate_transaction(transaction: Transaction, check_signature: bool = False) TransactionOnNetwork[source]

Simulates a transaction.

class multiversx_sdk.AwaitingOptions(polling_interval_in_milliseconds: int = 6000, timeout_in_milliseconds: int = 90000, patience_in_milliseconds: int = 3000)[source]

Bases: object

patience_in_milliseconds: int = 3000
polling_interval_in_milliseconds: int = 6000
timeout_in_milliseconds: int = 90000
class multiversx_sdk.BlockCoordinates(nonce: str, hash: bytes, root_hash: bytes)[source]

Bases: object

hash: bytes
nonce: str
root_hash: bytes
class multiversx_sdk.BlockOnNetwork(raw: dict[str, Any], shard: int, nonce: int, hash: bytes, previous_hash: bytes, timestamp: int, round: int, epoch: int)[source]

Bases: object

epoch: int
hash: bytes
nonce: int
previous_hash: bytes
raw: dict[str, Any]
round: int
shard: int
timestamp: int
class multiversx_sdk.BurnOutcome(user_address: multiversx_sdk.core.address.Address, token_identifier: str, nonce: int, burnt_supply: int)[source]

Bases: object

burnt_supply: int
nonce: int
token_identifier: str
user_address: Address
class multiversx_sdk.BurnQuantityOutcome(token_identifier: str, nonce: int, burnt_quantity: int)[source]

Bases: object

burnt_quantity: int
nonce: int
token_identifier: str
class multiversx_sdk.CodeMetadata(upgradeable: bool = True, readable: bool = True, payable: bool = False, payable_by_contract: bool = False)[source]

Bases: object

classmethod new_from_bytes(data: bytes) CodeMetadata[source]
serialize() bytes[source]
class multiversx_sdk.CreateNewDelegationContractOutcome(contract_address: multiversx_sdk.core.address.Address)[source]

Bases: object

contract_address: Address
class multiversx_sdk.DelegationController(chain_id: str, network_provider: INetworkProvider)[source]

Bases: object

await_completed_create_new_delegation_contract(transaction_hash: str | bytes) list[CreateNewDelegationContractOutcome][source]
create_transaction_for_adding_nodes(sender: IAccount, nonce: int, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey], signed_messages: Sequence[bytes], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_changing_service_fee(sender: IAccount, nonce: int, delegation_contract: Address, service_fee: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_claiming_rewards(sender: IAccount, nonce: int, delegation_contract: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_delegating(sender: IAccount, nonce: int, delegation_contract: Address, amount: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_modifying_delegation_cap(sender: IAccount, nonce: int, delegation_contract: Address, delegation_cap: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_new_delegation_contract(sender: IAccount, nonce: int, total_delegation_cap: int, service_fee: int, amount: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_redelegating_rewards(sender: IAccount, nonce: int, delegation_contract: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_removing_nodes(sender: IAccount, nonce: int, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_setting_automatic_activation(sender: IAccount, nonce: int, delegation_contract: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_setting_cap_check_on_redelegate_rewards(sender: IAccount, nonce: int, delegation_contract: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_setting_metadata(sender: IAccount, nonce: int, delegation_contract: Address, name: str, website: str, identifier: str, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_staking_nodes(sender: IAccount, nonce: int, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_unbonding_nodes(sender: IAccount, nonce: int, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_undelegating(sender: IAccount, nonce: int, delegation_contract: Address, amount: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_unjailing_nodes(sender: IAccount, nonce: int, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey], amount: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_unsetting_automatic_activation(sender: IAccount, nonce: int, delegation_contract: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_unsetting_cap_check_on_redelegate_rewards(sender: IAccount, nonce: int, delegation_contract: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_unstaking_nodes(sender: IAccount, nonce: int, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_withdrawing(sender: IAccount, nonce: int, delegation_contract: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
parse_create_new_delegation_contract(transaction_on_network: TransactionOnNetwork) list[CreateNewDelegationContractOutcome][source]
class multiversx_sdk.DelegationTransactionsFactory(config: TransactionsFactoryConfig)[source]

Bases: object

create_transaction_for_adding_nodes(sender: Address, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey], signed_messages: Sequence[bytes]) Transaction[source]
create_transaction_for_changing_service_fee(sender: Address, delegation_contract: Address, service_fee: int) Transaction[source]
create_transaction_for_claiming_rewards(sender: Address, delegation_contract: Address) Transaction[source]
create_transaction_for_delegating(sender: Address, delegation_contract: Address, amount: int) Transaction[source]
create_transaction_for_modifying_delegation_cap(sender: Address, delegation_contract: Address, delegation_cap: int) Transaction[source]
create_transaction_for_new_delegation_contract(sender: Address, total_delegation_cap: int, service_fee: int, amount: int) Transaction[source]
create_transaction_for_redelegating_rewards(sender: Address, delegation_contract: Address) Transaction[source]
create_transaction_for_removing_nodes(sender: Address, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey]) Transaction[source]
create_transaction_for_setting_automatic_activation(sender: Address, delegation_contract: Address) Transaction[source]
create_transaction_for_setting_cap_check_on_redelegate_rewards(sender: Address, delegation_contract: Address) Transaction[source]
create_transaction_for_setting_metadata(sender: Address, delegation_contract: Address, name: str, website: str, identifier: str) Transaction[source]
create_transaction_for_staking_nodes(sender: Address, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey]) Transaction[source]
create_transaction_for_unbonding_nodes(sender: Address, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey]) Transaction[source]
create_transaction_for_undelegating(sender: Address, delegation_contract: Address, amount: int) Transaction[source]
create_transaction_for_unjailing_nodes(sender: Address, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey], amount: int) Transaction[source]
create_transaction_for_unsetting_automatic_activation(sender: Address, delegation_contract: Address) Transaction[source]
create_transaction_for_unsetting_cap_check_on_redelegate_rewards(sender: Address, delegation_contract: Address) Transaction[source]
create_transaction_for_unstaking_nodes(sender: Address, delegation_contract: Address, public_keys: Sequence[ValidatorPublicKey]) Transaction[source]
create_transaction_for_withdrawing(sender: Address, delegation_contract: Address) Transaction[source]
class multiversx_sdk.DelegationTransactionsOutcomeParser[source]

Bases: object

parse_create_new_delegation_contract(transaction: TransactionOnNetwork) list[CreateNewDelegationContractOutcome][source]
class multiversx_sdk.DeployedSmartContract(address: multiversx_sdk.core.address.Address, owner_address: multiversx_sdk.core.address.Address, code_hash: bytes)[source]

Bases: object

address: Address
code_hash: bytes
owner_address: Address
class multiversx_sdk.DevnetEntrypoint(url: str | None = None, kind: str | None = None)[source]

Bases: NetworkEntrypoint

class multiversx_sdk.FreezeOutcome(user_address: multiversx_sdk.core.address.Address, token_identifier: str, nonce: int, balance: int)[source]

Bases: object

balance: int
nonce: int
token_identifier: str
user_address: Address
class multiversx_sdk.FungibleTokenMetadata(raw: dict[str, Any], identifier: str, name: str, ticker: str, owner: str, decimals: int)[source]

Bases: object

decimals: int
identifier: str
name: str
owner: str
raw: dict[str, Any]
ticker: str
exception multiversx_sdk.GenericError(url: str, data: Any)[source]

Bases: Exception

class multiversx_sdk.GenericResponse(data: Any)[source]

Bases: object

get(key: str, default: Any = None) Any[source]
to_dictionary() dict[str, Any][source]
class multiversx_sdk.GetBlockArguments(shard: int | None = None, block_nonce: int | None = None, block_hash: bytes | None = None)[source]

Bases: object

block_hash: bytes | None = None
block_nonce: int | None = None
shard: int | None = None
class multiversx_sdk.IssueFungibleOutcome(token_identifier: str)[source]

Bases: object

token_identifier: str
class multiversx_sdk.IssueNonFungibleOutcome(token_identifier: str)[source]

Bases: object

token_identifier: str
class multiversx_sdk.IssueSemiFungibleOutcome(token_identifier: str)[source]

Bases: object

token_identifier: str
class multiversx_sdk.KeyPair(secret_key: UserSecretKey)[source]

Bases: object

static generate() KeyPair[source]
get_public_key() UserPublicKey[source]
get_secret_key() UserSecretKey[source]
static new_from_bytes(data: bytes) KeyPair[source]
sign(data: bytes) bytes[source]

Signs using the secret key of the keypair.

verify(data: bytes, signature: bytes) bool[source]

Verifies using the public key of the keypair.

class multiversx_sdk.LibraryConfig(default_address_hrp: str = 'erd')[source]

Bases: object

Global configuration of the library.

Generally speaking, this configuration should only be altered in exotic use cases. It can be seen as a collection of constants or, more precisely, variables that are rarely changed and used throughout the library.

Never alter the configuration within a library! Only alter the configuration, if needed, within a final application that uses this library.

default_address_hrp: str = 'erd'
class multiversx_sdk.MainnetEntrypoint(url: str | None = None, kind: str | None = None)[source]

Bases: NetworkEntrypoint

class multiversx_sdk.Message(data: bytes, signature: bytes = b'', address: Address | None = None, version: int = 1, signer: str = 'sdk-py')[source]

Bases: object

class multiversx_sdk.MessageComputer[source]

Bases: object

Also see:
compute_bytes_for_signing(message: Message) bytes[source]
compute_bytes_for_verifying(message: Message) bytes[source]
pack_message(message: Message) Dict[str, Any][source]
unpack_message(packed_message: Dict[str, Any]) Message[source]
class multiversx_sdk.MintOutcome(user_address: multiversx_sdk.core.address.Address, token_identifier: str, nonce: int, minted_supply: int)[source]

Bases: object

minted_supply: int
nonce: int
token_identifier: str
user_address: Address
class multiversx_sdk.Mnemonic(text: str)[source]

Bases: object

classmethod assert_text_is_valid(text: str) None[source]
derive_key(address_index: int = 0) UserSecretKey[source]
classmethod from_entropy(entropy: bytes) Mnemonic[source]
classmethod generate() Mnemonic[source]
get_entropy() bytes[source]
get_text() str[source]
get_words() list[str][source]
classmethod is_text_valid(text: str) bool[source]
class multiversx_sdk.NFTCreateOutcome(token_identifier: str, nonce: int, initial_quantity: int)[source]

Bases: object

initial_quantity: int
nonce: int
token_identifier: str
class multiversx_sdk.NetworkConfig(raw: dict[str, Any], chain_id: str, gas_per_data_byte: int, gas_price_modifier: float, min_gas_limit: int, min_gas_price: int, extra_gas_limit_for_guarded_transactions: int, num_shards: int, round_duration: int, num_rounds_per_epoch: int, genesis_timestamp: int)[source]

Bases: object

chain_id: str
extra_gas_limit_for_guarded_transactions: int
gas_per_data_byte: int
gas_price_modifier: float
genesis_timestamp: int
min_gas_limit: int
min_gas_price: int
num_rounds_per_epoch: int
num_shards: int
raw: dict[str, Any]
round_duration: int
class multiversx_sdk.NetworkEntrypoint(network_provider_url: str, network_provider_kind: str, chain_id: str)[source]

Bases: object

await_transaction_completed(tx_hash: str | bytes) TransactionOnNetwork[source]
create_account() Account[source]

Generates a new secret key and instantiates an account.

create_account_controller() AccountController[source]
create_account_transactions_factory() AccountTransactionsFactory[source]
create_delegation_controller() DelegationController[source]
create_delegation_transactions_factory() DelegationTransactionsFactory[source]
create_network_provider() ApiNetworkProvider | ProxyNetworkProvider[source]
create_relayed_controller() RelayedController[source]
create_relayed_transactions_factory() RelayedTransactionsFactory[source]
create_smart_contract_controller(abi: Abi | None = None) SmartContractController[source]
create_smart_contract_transactions_factory(abi: Abi | None = None) SmartContractTransactionsFactory[source]
create_token_management_controller() TokenManagementController[source]
create_token_management_transactions_factory() TokenManagementTransactionsFactory[source]
create_transfers_controller() TransfersController[source]
create_transfers_transactions_factory() TransferTransactionsFactory[source]
get_airdrop(address: Address) None[source]

Get xEGLD tokens on Devnet or Testnet.

get_transaction(tx_hash: str | bytes) TransactionOnNetwork[source]
recall_account_nonce(address: Address) int[source]
send_transaction(transaction: Transaction) bytes[source]
send_transactions(transactions: list[Transaction]) tuple[int, list[bytes]][source]

Sends multiple transactions.

Args:

transactions (list[Transaction]): An iterable containing multiple transactions (e.g. a list of transactions).

Returns:

tuple (int, list[bytes]): The integer indicates the total number of transactions sent, while the list contains the transactions hashes. If a transaction is not sent, the hash is empty.

verify_message_signature(message: Message) bool[source]
verify_transaction_signature(transaction: Transaction) bool[source]
class multiversx_sdk.NetworkProviderConfig(client_name: str | None = None, requests_options: dict[str, Any] | None = None)[source]

Bases: object

class multiversx_sdk.NetworkStatus(raw: dict[str, Any], block_timestamp: int, block_nonce: int, highest_final_block_nonce: int, current_round: int, current_epoch: int)[source]

Bases: object

block_nonce: int
block_timestamp: int
current_epoch: int
current_round: int
highest_final_block_nonce: int
raw: dict[str, Any]
class multiversx_sdk.ParsedSmartContractCallOutcome(values: list[Any], return_code: str, return_message: str)[source]

Bases: object

return_code: str
return_message: str
values: list[Any]
class multiversx_sdk.PauseOutcome(token_identifier: str)[source]

Bases: object

token_identifier: str
class multiversx_sdk.ProxyNetworkProvider(url: str, address_hrp: str | None = None, config: NetworkProviderConfig | None = None)[source]

Bases: INetworkProvider

await_account_on_condition(address: Address, condition: Callable[[AccountOnNetwork], bool], options: AwaitingOptions | None = None) AccountOnNetwork[source]

Waits until an account satisfies a given condition.

await_transaction_completed(transaction_hash: bytes | str, options: AwaitingOptions | None = None) TransactionOnNetwork[source]

Waits until the transaction is completely processed.

await_transaction_on_condition(transaction_hash: str | bytes, condition: Callable[[TransactionOnNetwork], bool], options: AwaitingOptions | None = None) TransactionOnNetwork[source]

Waits until a transaction satisfies a given condition.

do_get_generic(url: str, url_parameters: dict[str, Any] | None = None) GenericResponse[source]

Does a generic GET request against the network (handles API enveloping).

do_post_generic(url: str, data: Any, url_parameters: dict[str, Any] | None = None) GenericResponse[source]

Does a generic GET request against the network (handles API enveloping).

estimate_transaction_cost(transaction: Transaction) TransactionCostResponse[source]

Estimates the cost of a transaction.

get_account(address: Address) AccountOnNetwork[source]

Fetches account information for a given address.

get_account_storage(address: Address) AccountStorage[source]

Fetches the storage (key-value pairs) of an account. When decoding the keys, the errors are ignored. Use the raw values if needed.

get_account_storage_entry(address: Address, entry_key: str) AccountStorageEntry[source]

Fetches a specific storage entry of an account.

get_block(arguments: GetBlockArguments) BlockOnNetwork[source]

Fetches a block by nonce or by hash.

get_definition_of_fungible_token(token_identifier: str) FungibleTokenMetadata[source]

Fetches the definition of a fungible token.

get_definition_of_tokens_collection(collection_name: str) TokensCollectionMetadata[source]

Fetches the definition of a tokens collection.

get_fungible_tokens_of_account(address: Address) list[TokenAmountOnNetwork][source]

Fetches the balances of an account, for all fungible tokens held by the account. Pagination isn’t explicitly handled by a basic network provider, but can be achieved by using do_get_generic.

get_latest_block(shard: int = 4294967295) BlockOnNetwork[source]

Fetches the latest block of a shard.

get_network_config() NetworkConfig[source]

Fetches the general configuration of the network.

get_network_status(shard: int = 4294967295) NetworkStatus[source]

Fetches the current status of the network.

get_non_fungible_tokens_of_account(address: Address) list[TokenAmountOnNetwork][source]

Fetches the balances of an account, for all non-fungible tokens held by the account. Pagination isn’t explicitly handled by a basic network provider, but can be achieved by using do_get_generic.

get_token_of_account(address: Address, token: Token) TokenAmountOnNetwork[source]

Fetches the balance of an account, for a given token. Able to handle both fungible and non-fungible tokens (NFTs, SFTs, MetaESDTs).

get_transaction(transaction_hash: bytes | str) TransactionOnNetwork[source]

Fetches a transaction that was previously broadcasted (maybe already processed by the network).

get_transaction_status(tx_hash: str) TransactionStatus[source]

Fetches the status of a transaction.

query_contract(query: SmartContractQuery) SmartContractQueryResponse[source]

Queries a smart contract.

send_transaction(transaction: Transaction) bytes[source]

Broadcasts a transaction and returns its hash.

send_transactions(transactions: list[Transaction]) tuple[int, list[bytes]][source]

Broadcasts multiple transactions and returns a tuple of (number of accepted transactions, list of transaction hashes). In the returned list, the order of transaction hashes corresponds to the order of transactions in the input list. If a transaction is not accepted, its hash is empty in the returned list.

simulate_transaction(transaction: Transaction, check_signature: bool = False) TransactionOnNetwork[source]

Simulates a transaction.

class multiversx_sdk.RegisterAndSetAllRolesOutcome(token_identifier: str, roles: list[str])[source]

Bases: object

roles: list[str]
token_identifier: str
class multiversx_sdk.RegisterMetaEsdtOutcome(token_identifier: str)[source]

Bases: object

token_identifier: str
class multiversx_sdk.RelayedController(chain_id: str)[source]

Bases: object

The Relayed Transactions V1 and V2 will soon be deprecated from the network. Please use Relayed Transactions V3 instead. The transactions are created from the perspective of the relayer. The ‘sender’ represents the relayer.

create_relayed_v1_transaction(sender: IAccount, nonce: int, inner_transaction: Transaction) Transaction[source]
create_relayed_v2_transaction(sender: IAccount, nonce: int, inner_transaction: Transaction, inner_transaction_gas_limit: int) Transaction[source]
class multiversx_sdk.RelayedTransactionsFactory(config: TransactionsFactoryConfig)[source]

Bases: object

The Relayed Transactions V1 and V2 will soon be deprecated from the network. Please use Relayed Transactions V3 instead. The transactions are created from the perspective of the relayer. The ‘sender’ represents the relayer.

create_relayed_v1_transaction(inner_transaction: Transaction, relayer_address: Address) Transaction[source]
create_relayed_v2_transaction(inner_transaction: Transaction, inner_transaction_gas_limit: int, relayer_address: Address) Transaction[source]
class multiversx_sdk.SetSpecialRoleOutcome(user_address: multiversx_sdk.core.address.Address, token_identifier: str, roles: list[str])[source]

Bases: object

roles: list[str]
token_identifier: str
user_address: Address
class multiversx_sdk.SmartContractController(chain_id: str, network_provider: INetworkProvider, abi: Abi | None = None)[source]

Bases: object

await_completed_deploy(transaction_hash: str | bytes) SmartContractDeployOutcome[source]
await_completed_execute(transaction_hash: str | bytes) ParsedSmartContractCallOutcome[source]
create_query(contract: Address, function: str, arguments: list[Any], caller: Address | None = None, value: int | None = None) SmartContractQuery[source]
create_transaction_for_deploy(sender: IAccount, nonce: int, bytecode: Path | bytes, gas_limit: int, arguments: Sequence[Any] = [], native_transfer_amount: int = 0, is_upgradeable: bool = True, is_readable: bool = True, is_payable: bool = False, is_payable_by_sc: bool = True, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_execute(sender: IAccount, nonce: int, contract: Address, gas_limit: int, function: str, arguments: Sequence[Any] = [], native_transfer_amount: int = 0, token_transfers: list[TokenTransfer] = [], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_upgrade(sender: IAccount, nonce: int, contract: Address, bytecode: Path | bytes, gas_limit: int, arguments: Sequence[Any] = [], native_transfer_amount: int = 0, is_upgradeable: bool = True, is_readable: bool = True, is_payable: bool = False, is_payable_by_sc: bool = True, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
parse_deploy(transaction_on_network: TransactionOnNetwork) SmartContractDeployOutcome[source]
parse_execute(transaction_on_network: TransactionOnNetwork, function: str | None = None) ParsedSmartContractCallOutcome[source]
parse_query_response(response: SmartContractQueryResponse) list[Any][source]
query(contract: Address, function: str, arguments: list[Any], caller: Address | None = None, value: int | None = None) list[Any][source]

It calls create_query(), run_query() and parse_query_response() in one go.

run_query(query: SmartContractQuery) SmartContractQueryResponse[source]
class multiversx_sdk.SmartContractDeployOutcome(return_code: str, return_message: str, contracts: list[multiversx_sdk.smart_contracts.smart_contract_transactions_outcome_parser_types.DeployedSmartContract])[source]

Bases: object

contracts: list[DeployedSmartContract]
return_code: str
return_message: str
class multiversx_sdk.SmartContractQuery(contract: Address, function: str, arguments: list[bytes], caller: Address | None = None, value: int | None = None)[source]

Bases: object

class multiversx_sdk.SmartContractQueryResponse(function: str, return_code: str, return_message: str, return_data_parts: list[bytes])[source]

Bases: object

class multiversx_sdk.SmartContractResult(raw: dict[str, Any], sender: multiversx_sdk.core.address.Address, receiver: multiversx_sdk.core.address.Address, data: bytes, logs: multiversx_sdk.core.transaction_on_network.TransactionLogs)[source]

Bases: object

data: bytes
logs: TransactionLogs
raw: dict[str, Any]
receiver: Address
sender: Address
class multiversx_sdk.SmartContractTransactionsFactory(config: TransactionsFactoryConfig, abi: Abi | None = None)[source]

Bases: object

create_transaction_for_changing_owner_address(sender: Address, contract: Address, new_owner: Address) Transaction[source]
create_transaction_for_claiming_developer_rewards(sender: Address, contract: Address) Transaction[source]
create_transaction_for_deploy(sender: Address, bytecode: Path | bytes, gas_limit: int, arguments: Sequence[Any] = [], native_transfer_amount: int = 0, is_upgradeable: bool = True, is_readable: bool = True, is_payable: bool = False, is_payable_by_sc: bool = True) Transaction[source]
create_transaction_for_execute(sender: Address, contract: Address, function: str, gas_limit: int, arguments: Sequence[Any] = [], native_transfer_amount: int = 0, token_transfers: list[TokenTransfer] = []) Transaction[source]
create_transaction_for_upgrade(sender: Address, contract: Address, bytecode: Path | bytes, gas_limit: int, arguments: Sequence[Any] = [], native_transfer_amount: int = 0, is_upgradeable: bool = True, is_readable: bool = True, is_payable: bool = False, is_payable_by_sc: bool = True) Transaction[source]
class multiversx_sdk.SmartContractTransactionsOutcomeParser(abi: Abi | None = None)[source]

Bases: object

parse_deploy(transaction: TransactionOnNetwork) SmartContractDeployOutcome[source]
parse_execute(transaction: TransactionOnNetwork, function: str | None = None) ParsedSmartContractCallOutcome[source]
class multiversx_sdk.TestnetEntrypoint(url: str | None = None, kind: str | None = None)[source]

Bases: NetworkEntrypoint

class multiversx_sdk.Token(identifier: str, nonce: int = 0)[source]

Bases: object

class multiversx_sdk.TokenAmountOnNetwork(raw: dict[str, Any], token: multiversx_sdk.core.tokens.Token, amount: int, block_coordinates: multiversx_sdk.network_providers.resources.BlockCoordinates | None = None)[source]

Bases: object

amount: int
block_coordinates: BlockCoordinates | None = None
raw: dict[str, Any]
token: Token
class multiversx_sdk.TokenComputer[source]

Bases: object

compute_extended_identifier(token: Token) str[source]
compute_extended_identifier_from_identifier_and_nonce(identifier: str, nonce: int) str[source]
compute_extended_identifier_from_parts(parts: TokenIdentifierParts) str[source]
extract_identifier_from_extended_identifier(identifier: str) str[source]
extract_nonce_from_extended_identifier(identifier: str) int[source]
extract_ticker_from_identifier(identifier: str) str[source]
is_fungible(token: Token) bool[source]
parse_extended_identifier_parts(identifier: str) TokenIdentifierParts[source]
class multiversx_sdk.TokenIdentifierParts(ticker: str, random_sequence: str, nonce: int, prefix: str | None = None)[source]

Bases: object

class multiversx_sdk.TokenManagementController(chain_id: str, network_provider: INetworkProvider)[source]

Bases: object

await_completed_add_quantity(transaction_hash: str | bytes) list[AddQuantityOutcome][source]
await_completed_burn_quantity(transaction_hash: str | bytes) list[BurnQuantityOutcome][source]
await_completed_create_nft(transaction_hash: str | bytes) list[NFTCreateOutcome][source]
await_completed_freeze(transaction_hash: str | bytes) list[FreezeOutcome][source]
await_completed_issue_fungible(transaction_hash: str | bytes) list[IssueFungibleOutcome][source]
await_completed_issue_non_fungible(transaction_hash: str | bytes) list[IssueNonFungibleOutcome][source]
await_completed_issue_semi_fungible(transaction_hash: str | bytes) list[IssueSemiFungibleOutcome][source]
await_completed_local_burn(transaction_hash: str | bytes) list[BurnOutcome][source]
await_completed_local_mint(transaction_hash: str | bytes) list[MintOutcome][source]
await_completed_pause(transaction_hash: str | bytes) list[PauseOutcome][source]
await_completed_register_and_set_all_roles(transaction_hash: str | bytes) list[RegisterAndSetAllRolesOutcome][source]
await_completed_register_meta_esdt(transaction_hash: str | bytes) list[RegisterMetaEsdtOutcome][source]
await_completed_set_burn_role_globally(transaction_hash: str | bytes)[source]
await_completed_set_special_role_on_fungible_token(transaction_hash: str | bytes) list[SetSpecialRoleOutcome][source]
await_completed_set_special_role_on_non_fungible_token(transaction_hash: str | bytes) list[SetSpecialRoleOutcome][source]
await_completed_set_special_role_on_semi_fungible_token(transaction_hash: str | bytes) list[SetSpecialRoleOutcome][source]
await_completed_unfreeze(transaction_hash: str | bytes) list[UnFreezeOutcome][source]
await_completed_unpause(transaction_hash: str | bytes) list[UnPauseOutcome][source]
await_completed_unset_burn_role_globally(transaction_hash: str | bytes)[source]
await_completed_update_attributes(transaction_hash: str | bytes) list[UpdateAttributesOutcome][source]
await_completed_wipe(transaction_hash: str | bytes) list[WipeOutcome][source]
create_transaction_for_adding_quantity(sender: IAccount, nonce: int, token_identifier: str, token_nonce: int, quantity_to_add: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_burning_quantity(sender: IAccount, nonce: int, token_identifier: str, token_nonce: int, quantity_to_burn: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_changing_sft_to_meta_esdt(sender: IAccount, nonce: int, collection: str, num_decimals: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_creating_nft(sender: IAccount, nonce: int, token_identifier: str, initial_quantity: int, name: str, royalties: int, hash: str, attributes: bytes, uris: list[str], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_freezing(sender: IAccount, nonce: int, user: Address, token_identifier: str, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_freezing_single_nft(sender: IAccount, nonce: int, token_identifier: str, token_nonce: int, user: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_issuing_fungible(sender: IAccount, nonce: int, token_name: str, token_ticker: str, initial_supply: int, num_decimals: int, can_freeze: bool, can_wipe: bool, can_pause: bool, can_change_owner: bool, can_upgrade: bool, can_add_special_roles: bool, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_issuing_non_fungible(sender: IAccount, nonce: int, token_name: str, token_ticker: str, can_freeze: bool, can_wipe: bool, can_pause: bool, can_transfer_nft_create_role: bool, can_change_owner: bool, can_upgrade: bool, can_add_special_roles: bool, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_issuing_semi_fungible(sender: IAccount, nonce: int, token_name: str, token_ticker: str, can_freeze: bool, can_wipe: bool, can_pause: bool, can_transfer_nft_create_role: bool, can_change_owner: bool, can_upgrade: bool, can_add_special_roles: bool, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_local_burning(sender: IAccount, nonce: int, token_identifier: str, supply_to_burn: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_local_minting(sender: IAccount, nonce: int, token_identifier: str, supply_to_mint: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_pausing(sender: IAccount, nonce: int, token_identifier: str, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_registering_and_setting_roles(sender: IAccount, nonce: int, token_name: str, token_ticker: str, token_type: TokenType, num_decimals: int, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_registering_meta_esdt(sender: IAccount, nonce: int, token_name: str, token_ticker: str, num_decimals: int, can_freeze: bool, can_wipe: bool, can_pause: bool, can_transfer_nft_create_role: bool, can_change_owner: bool, can_upgrade: bool, can_add_special_roles: bool, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_setting_burn_role_globally(sender: IAccount, nonce: int, token_identifier: str, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_setting_special_role_on_fungible_token(sender: IAccount, nonce: int, user: Address, token_identifier: str, add_role_local_mint: bool, add_role_local_burn: bool, add_role_esdt_transfer_role: bool, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_setting_special_role_on_non_fungible_token(sender: IAccount, nonce: int, user: Address, token_identifier: str, add_role_nft_create: bool, add_role_nft_burn: bool, add_role_nft_update_attributes: bool, add_role_nft_add_uri: bool, add_role_esdt_transfer_role: bool, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_setting_special_role_on_semi_fungible_token(sender: IAccount, nonce: int, user: Address, token_identifier: str, add_role_nft_create: bool, add_role_nft_burn: bool, add_role_nft_add_quantity: bool, add_role_esdt_transfer_role: bool, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_stopping_nft_creation(sender: IAccount, nonce: int, token_identifier: str, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_transferring_nft_create_role(sender: IAccount, nonce: int, token_identifier: str, user: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_transferring_ownership(sender: IAccount, nonce: int, token_identifier: str, new_owner: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_unfreezing(sender: IAccount, nonce: int, user: Address, token_identifier: str, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_unfreezing_single_nft(sender: IAccount, nonce: int, token_identifier: str, token_nonce: int, user: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_unpausing(sender: IAccount, nonce: int, token_identifier: str, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_unsetting_burn_role_globally(sender: IAccount, nonce: int, token_identifier: str, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_updating_attributes(sender: IAccount, nonce: int, token_identifier: str, token_nonce: int, attributes: bytes, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_wiping(sender: IAccount, nonce: int, user: Address, token_identifier: str, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_wiping_single_nft(sender: IAccount, nonce: int, token_identifier: str, token_nonce: int, user: Address, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transction_for_adding_uris(sender: IAccount, nonce: int, token_identifier: str, uris: list[str], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
parse_add_quantity(transaction_on_network: TransactionOnNetwork) list[AddQuantityOutcome][source]
parse_burn_quantity(transaction_on_network: TransactionOnNetwork) list[BurnQuantityOutcome][source]
parse_create_nft(transaction_on_network: TransactionOnNetwork) list[NFTCreateOutcome][source]
parse_freeze(transaction_on_network: TransactionOnNetwork) list[FreezeOutcome][source]
parse_issue_fungible(transaction_on_network: TransactionOnNetwork) list[IssueFungibleOutcome][source]
parse_issue_non_fungible(transaction_on_network: TransactionOnNetwork) list[IssueNonFungibleOutcome][source]
parse_issue_semi_fungible(transaction_on_network: TransactionOnNetwork) list[IssueSemiFungibleOutcome][source]
parse_local_burn(transaction_on_network: TransactionOnNetwork) list[BurnOutcome][source]
parse_local_mint(transaction_on_network: TransactionOnNetwork) list[MintOutcome][source]
parse_pause(transaction_on_network: TransactionOnNetwork) list[PauseOutcome][source]
parse_register_and_set_all_roles(transaction_on_network: TransactionOnNetwork) list[RegisterAndSetAllRolesOutcome][source]
parse_register_meta_esdt(transaction_on_network: TransactionOnNetwork) list[RegisterMetaEsdtOutcome][source]
parse_set_burn_role_globally(transaction_on_network: TransactionOnNetwork)[source]
parse_set_special_role_on_fungible_token(transaction_on_network: TransactionOnNetwork) list[SetSpecialRoleOutcome][source]
parse_set_special_role_on_non_fungible_token(transaction_on_network: TransactionOnNetwork) list[SetSpecialRoleOutcome][source]
parse_set_special_role_on_semi_fungible_token(transaction_on_network: TransactionOnNetwork) list[SetSpecialRoleOutcome][source]
parse_unfreeze(transaction_on_network: TransactionOnNetwork) list[UnFreezeOutcome][source]
parse_unpause(transaction_on_network: TransactionOnNetwork) list[UnPauseOutcome][source]
parse_unset_burn_role_globally(transaction_on_network: TransactionOnNetwork)[source]
parse_update_attributes(transaction_on_network: TransactionOnNetwork) list[UpdateAttributesOutcome][source]
parse_wipe(transaction_on_network: TransactionOnNetwork) list[WipeOutcome][source]
class multiversx_sdk.TokenManagementTransactionsFactory(config: TransactionsFactoryConfig)[source]

Bases: object

create_transaction_for_adding_quantity(sender: Address, token_identifier: str, token_nonce: int, quantity_to_add: int) Transaction[source]
create_transaction_for_burning_quantity(sender: Address, token_identifier: str, token_nonce: int, quantity_to_burn: int) Transaction[source]
create_transaction_for_changing_sft_to_meta_esdt(sender: Address, collection: str, num_decimals: int) Transaction[source]
create_transaction_for_changing_token_to_dynamic(sender: Address, token_identifier: str) Transaction[source]

The following token types cannot be changed to dynamic: FungibleESDT, NonFungibleESDT, NonFungibleESDTv2

create_transaction_for_creating_nft(sender: Address, token_identifier: str, initial_quantity: int, name: str, royalties: int, hash: str, attributes: bytes, uris: list[str]) Transaction[source]
create_transaction_for_freezing(sender: Address, user: Address, token_identifier: str) Transaction[source]

Can be used for FungibleESDT

create_transaction_for_freezing_single_nft(sender: Address, token_identifier: str, token_nonce: int, user: Address) Transaction[source]
create_transaction_for_issuing_fungible(sender: Address, token_name: str, token_ticker: str, initial_supply: int, num_decimals: int, can_freeze: bool, can_wipe: bool, can_pause: bool, can_change_owner: bool, can_upgrade: bool, can_add_special_roles: bool) Transaction[source]
create_transaction_for_issuing_non_fungible(sender: Address, token_name: str, token_ticker: str, can_freeze: bool, can_wipe: bool, can_pause: bool, can_transfer_nft_create_role: bool, can_change_owner: bool, can_upgrade: bool, can_add_special_roles: bool) Transaction[source]
create_transaction_for_issuing_semi_fungible(sender: Address, token_name: str, token_ticker: str, can_freeze: bool, can_wipe: bool, can_pause: bool, can_transfer_nft_create_role: bool, can_change_owner: bool, can_upgrade: bool, can_add_special_roles: bool) Transaction[source]
create_transaction_for_local_burning(sender: Address, token_identifier: str, supply_to_burn: int) Transaction[source]
create_transaction_for_local_minting(sender: Address, token_identifier: str, supply_to_mint: int) Transaction[source]
create_transaction_for_modifying_creator(sender: Address, token_identifier: str, token_nonce: int) Transaction[source]
create_transaction_for_modifying_royalties(sender: Address, token_identifier: str, token_nonce: int, new_royalties: int) Transaction[source]
create_transaction_for_nft_metadata_recreate(sender: Address, token_identifier: str, token_nonce: int, new_token_name: str, new_royalties: int, new_hash: str, new_attributes: bytes, new_uris: list[str]) Transaction[source]
create_transaction_for_pausing(sender: Address, token_identifier: str) Transaction[source]
create_transaction_for_registering_and_setting_roles(sender: Address, token_name: str, token_ticker: str, token_type: TokenType, num_decimals: int) Transaction[source]
create_transaction_for_registering_dynamic_and_setting_roles(sender: Address, token_name: str, token_ticker: str, token_type: TokenType, denominator: int | None = None) Transaction[source]
create_transaction_for_registering_dynamic_token(sender: Address, token_name: str, token_ticker: str, token_type: TokenType, denominator: int | None = None) Transaction[source]
create_transaction_for_registering_meta_esdt(sender: Address, token_name: str, token_ticker: str, num_decimals: int, can_freeze: bool, can_wipe: bool, can_pause: bool, can_transfer_nft_create_role: bool, can_change_owner: bool, can_upgrade: bool, can_add_special_roles: bool) Transaction[source]
create_transaction_for_setting_burn_role_globally(sender: Address, token_identifier: str) Transaction[source]
create_transaction_for_setting_new_uris(sender: Address, token_identifier: str, token_nonce: int, new_uris: list[str]) Transaction[source]
create_transaction_for_setting_special_role_on_fungible_token(sender: Address, user: Address, token_identifier: str, add_role_local_mint: bool, add_role_local_burn: bool, add_role_esdt_transfer_role: bool) Transaction[source]
create_transaction_for_setting_special_role_on_non_fungible_token(sender: Address, user: Address, token_identifier: str, add_role_nft_create: bool = False, add_role_nft_burn: bool = False, add_role_nft_update_attributes: bool = False, add_role_nft_add_uri: bool = False, add_role_esdt_transfer_role: bool = False, add_role_nft_update: bool = False, add_role_esdt_modify_royalties: bool = False, add_role_esdt_set_new_uri: bool = False, add_role_esdt_modify_creator: bool = False, add_role_nft_recreate: bool = False) Transaction[source]
create_transaction_for_setting_special_role_on_semi_fungible_token(sender: Address, user: Address, token_identifier: str, add_role_nft_create: bool = False, add_role_nft_burn: bool = False, add_role_nft_add_quantity: bool = False, add_role_esdt_transfer_role: bool = False, add_role_nft_update: bool = False, add_role_esdt_modify_royalties: bool = False, add_role_esdt_set_new_uri: bool = False, add_role_esdt_modify_creator: bool = False, add_role_nft_recreate: bool = False) Transaction[source]
create_transaction_for_stopping_nft_creation(sender: Address, token_identifier: str) Transaction[source]
create_transaction_for_transferring_nft_create_role(sender: Address, token_identifier: str, user: Address) Transaction[source]

This role can be transferred only if the canTransferNFTCreateRole property of the token is set to true.

create_transaction_for_transferring_ownership(sender: Address, token_identifier: str, new_owner: Address) Transaction[source]
create_transaction_for_unfreezing(sender: Address, user: Address, token_identifier: str) Transaction[source]

Can be used for FungibleESDT

create_transaction_for_unfreezing_single_nft(sender: Address, token_identifier: str, token_nonce: int, user: Address) Transaction[source]
create_transaction_for_unpausing(sender: Address, token_identifier: str) Transaction[source]
create_transaction_for_unsetting_burn_role_globally(sender: Address, token_identifier: str) Transaction[source]
create_transaction_for_unsetting_special_role_on_fungible_token(sender: Address, user: Address, token_identifier: str, remove_role_local_mint: bool, remove_role_local_burn: bool, remove_role_esdt_transfer_role: bool) Transaction[source]
create_transaction_for_unsetting_special_role_on_non_fungible_token(sender: Address, user: Address, token_identifier: str, remove_role_nft_burn: bool = False, remove_role_nft_update_attributes: bool = False, remove_role_nft_remove_uri: bool = False, remove_role_esdt_transfer_role: bool = False, remove_role_nft_update: bool = False, remove_role_esdt_modify_royalties: bool = False, remove_role_esdt_set_new_uri: bool = False, remove_role_esdt_modify_creator: bool = False, remove_role_nft_recreate: bool = False) Transaction[source]
create_transaction_for_unsetting_special_role_on_semi_fungible_token(sender: Address, user: Address, token_identifier: str, remove_role_nft_burn: bool = False, remove_role_nft_add_quantity: bool = False, remove_role_esdt_transfer_role: bool = False, remove_role_nft_update: bool = False, remove_role_esdt_modify_royalties: bool = False, remove_role_esdt_set_new_uri: bool = False, remove_role_esdt_modify_creator: bool = False, remove_role_nft_recreate: bool = False) Transaction[source]
create_transaction_for_updating_attributes(sender: Address, token_identifier: str, token_nonce: int, attributes: bytes) Transaction[source]
create_transaction_for_updating_metadata(sender: Address, token_identifier: str, token_nonce: int, new_token_name: str, new_royalties: int, new_hash: str, new_attributes: bytes, new_uris: list[str]) Transaction[source]
create_transaction_for_updating_token_id(sender: Address, token_identifier: str) Transaction[source]
create_transaction_for_wiping(sender: Address, user: Address, token_identifier: str) Transaction[source]
create_transaction_for_wiping_single_nft(sender: Address, token_identifier: str, token_nonce: int, user: Address) Transaction[source]
create_transction_for_adding_uris(sender: Address, token_identifier: str, uris: list[str]) Transaction[source]
class multiversx_sdk.TokenManagementTransactionsOutcomeParser[source]

Bases: object

parse_add_quantity(transaction: TransactionOnNetwork) list[AddQuantityOutcome][source]
parse_burn_quantity(transaction: TransactionOnNetwork) list[BurnQuantityOutcome][source]
parse_freeze(transaction: TransactionOnNetwork) list[FreezeOutcome][source]
parse_issue_fungible(transaction: TransactionOnNetwork) list[IssueFungibleOutcome][source]
parse_issue_non_fungible(transaction: TransactionOnNetwork) list[IssueNonFungibleOutcome][source]
parse_issue_semi_fungible(transaction: TransactionOnNetwork) list[IssueSemiFungibleOutcome][source]
parse_local_burn(transaction: TransactionOnNetwork) list[BurnOutcome][source]
parse_local_mint(transaction: TransactionOnNetwork) list[MintOutcome][source]
parse_nft_create(transaction: TransactionOnNetwork) list[NFTCreateOutcome][source]
parse_pause(transaction: TransactionOnNetwork) list[PauseOutcome][source]
parse_register_and_set_all_roles(transaction: TransactionOnNetwork) list[RegisterAndSetAllRolesOutcome][source]
parse_register_meta_esdt(transaction: TransactionOnNetwork) list[RegisterMetaEsdtOutcome][source]
parse_set_burn_role_globally(transaction: TransactionOnNetwork) None[source]
parse_set_special_role(transaction: TransactionOnNetwork) list[SetSpecialRoleOutcome][source]
parse_unfreeze(transaction: TransactionOnNetwork) list[UnFreezeOutcome][source]
parse_unpause(transaction: TransactionOnNetwork) list[UnPauseOutcome][source]
parse_unset_burn_role_globally(transaction: TransactionOnNetwork) None[source]
parse_update_attributes(transaction: TransactionOnNetwork) list[UpdateAttributesOutcome][source]
parse_wipe(transaction: TransactionOnNetwork) list[WipeOutcome][source]
class multiversx_sdk.TokenTransfer(token: Token, amount: int)[source]

Bases: object

amount should always be in atomic units: 1.000000 “USDC-c76f1f” = “1000000

static new_from_native_amount(amount: int) TokenTransfer[source]
class multiversx_sdk.TokenType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

FNG = 'FNG'
META = 'META'
NFT = 'NFT'
SFT = 'SFT'
class multiversx_sdk.TokensCollectionMetadata(raw: dict[str, Any], collection: str, type: str, name: str, ticker: str, owner: str, decimals: int)[source]

Bases: object

collection: str
decimals: int
name: str
owner: str
raw: dict[str, Any]
ticker: str
type: str
class multiversx_sdk.Transaction(sender: Address, receiver: Address, gas_limit: int, chain_id: str, nonce: int | None = None, value: int | None = None, sender_username: str | None = None, receiver_username: str | None = None, gas_price: int | None = None, data: bytes | None = None, version: int | None = None, options: int | None = None, guardian: Address | None = None, signature: bytes | None = None, guardian_signature: bytes | None = None, relayer: Address | None = None, relayer_signature: bytes | None = None)[source]

Bases: object

static new_from_dictionary(dictionary: dict[str, Any]) Transaction[source]
to_dictionary() dict[str, Any][source]
class multiversx_sdk.TransactionAwaiter(fetcher: ITransactionFetcher, polling_interval_in_milliseconds: int | None = None, timeout_interval_in_milliseconds: int | None = None, patience_time_in_milliseconds: int | None = None)[source]

Bases: object

TransactionAwaiter allows one to await until a specific event (such as transaction completion) occurs on a given transaction.

Args:

fetcher (ITransactionFetcher): Used to fetch the transaction of the network. polling_interval_in_milliseconds (Optional[int]): The polling interval, in milliseconds. timeout_interval_in_milliseconds (Optional[int]): The timeout, in milliseconds. patience_time_in_milliseconds (Optional[int]): The patience, an extra time (in milliseconds) to wait, after the transaction has reached its desired status. Currently there’s a delay between the moment a transaction is marked as “completed” and the moment its outcome (contract results, events and logs) is available.

await_completed(transaction_hash: str | bytes) TransactionOnNetwork[source]

Waits until the transaction is completely processed.

await_on_condition(transaction_hash: str | bytes, condition: Callable[[TransactionOnNetwork], bool]) TransactionOnNetwork[source]

Waits until the condition is satisfied.

class multiversx_sdk.TransactionComputer[source]

Bases: object

apply_guardian(transaction: Transaction, guardian: Address) None[source]
apply_options_for_hash_signing(transaction: Transaction) None[source]
compute_bytes_for_signing(transaction: Transaction) bytes[source]
compute_bytes_for_verifying(transaction: Transaction) bytes[source]
compute_hash_for_signing(transaction: Transaction) bytes[source]
compute_transaction_fee(transaction: Transaction, network_config: INetworkConfig) int[source]

TransactionsFactoryConfig can be used here as the network_config.

compute_transaction_hash(transaction: Transaction) bytes[source]
has_options_set_for_guarded_transaction(transaction: Transaction) bool[source]
has_options_set_for_hash_signing(transaction: Transaction) bool[source]
is_relayed_v3_transaction(transaction: Transaction) bool[source]
class multiversx_sdk.TransactionCostResponse(raw: dict[str, Any], gas_limit: int, status: multiversx_sdk.core.transaction_status.TransactionStatus)[source]

Bases: object

gas_limit: int
raw: dict[str, Any]
status: TransactionStatus
class multiversx_sdk.TransactionDecoder[source]

Bases: object

get_esdt_transaction_metadata(metadata: TransactionMetadata) TransactionMetadata | None[source]
get_multi_transfer_metadata(metadata: TransactionMetadata) TransactionMetadata | None[source]
get_nft_transfer_metadata(metadata: TransactionMetadata) TransactionMetadata | None[source]
get_normal_transaction_metadata(transaction: TransactionOnNetwork) TransactionMetadata[source]
get_transaction_metadata(transaction: TransactionOnNetwork) TransactionMetadata[source]
hex_to_number(hex: str) int[source]
hex_to_string(hex: str) str[source]
is_address_valid(address: str) bool[source]
is_hex(value: str) bool[source]
is_smart_contract_call_argument(arg: str) bool[source]
class multiversx_sdk.TransactionEvent(raw: dict[str, Any], address: multiversx_sdk.core.address.Address, identifier: str, topics: list[bytes], data: bytes, additional_data: list[bytes])[source]

Bases: object

additional_data: list[bytes]
address: Address
data: bytes
identifier: str
raw: dict[str, Any]
topics: list[bytes]
class multiversx_sdk.TransactionEventsParser(abi: Abi, first_topic_as_identifier: bool = True)[source]

Bases: object

parse_event(event: TransactionEvent) SimpleNamespace[source]
parse_events(events: list[TransactionEvent]) list[SimpleNamespace][source]
class multiversx_sdk.TransactionLogs(address: multiversx_sdk.core.address.Address, events: list[multiversx_sdk.core.transaction_on_network.TransactionEvent])[source]

Bases: object

address: Address
events: list[TransactionEvent]
class multiversx_sdk.TransactionMetadata[source]

Bases: object

to_dict() dict[str, Any][source]
class multiversx_sdk.TransactionOnNetwork(raw: dict[str, Any], sender: multiversx_sdk.core.address.Address, receiver: multiversx_sdk.core.address.Address, hash: bytes, nonce: int, round: int, epoch: int, timestamp: int, block_hash: bytes, miniblock_hash: bytes, sender_shard: int, receiver_shard: int, value: int, gas_limit: int, gas_price: int, function: str, data: bytes, version: int, options: int, signature: bytes, status: multiversx_sdk.core.transaction_status.TransactionStatus, smart_contract_results: list[multiversx_sdk.core.transaction_on_network.SmartContractResult], logs: multiversx_sdk.core.transaction_on_network.TransactionLogs)[source]

Bases: object

block_hash: bytes
data: bytes
epoch: int
function: str
gas_limit: int
gas_price: int
hash: bytes
logs: TransactionLogs
miniblock_hash: bytes
nonce: int
options: int
raw: dict[str, Any]
receiver: Address
receiver_shard: int
round: int
sender: Address
sender_shard: int
signature: bytes
smart_contract_results: list[SmartContractResult]
status: TransactionStatus
timestamp: int
value: int
version: int
class multiversx_sdk.TransactionStatus(status: str)[source]

Bases: object

is_completed: bool
is_successful: bool
status: str
class multiversx_sdk.TransactionsFactoryConfig(chain_id: str, address_hrp: str = 'erd', min_gas_limit: int = 50000, gas_limit_per_byte: int = 1500, gas_limit_issue: int = 60000000, gas_limit_toggle_burn_role_globally: int = 60000000, gas_limit_esdt_local_mint: int = 300000, gas_limit_esdt_local_burn: int = 300000, gas_limit_set_special_role: int = 60000000, gas_limit_pausing: int = 60000000, gas_limit_freezing: int = 60000000, gas_limit_wiping: int = 60000000, gas_limit_esdt_nft_create: int = 3000000, gas_limit_esdt_nft_update_attributes: int = 1000000, gas_limit_esdt_nft_add_quantity: int = 1000000, gas_limit_esdt_nft_burn: int = 1000000, gas_limit_store_per_byte: int = 10000, gas_limit_esdt_modify_royalties: int = 60000000, gas_limit_set_new_uris: int = 60000000, gas_limit_esdt_modify_creator: int = 60000000, gas_limit_esdt_metadata_update: int = 60000000, gas_limit_nft_metadata_recreate: int = 60000000, gas_limit_nft_change_to_dynamic: int = 60000000, gas_limit_update_token_id: int = 60000000, gas_limit_register_dynamic: int = 60000000, issue_cost: int = 50000000000000000, gas_limit_transfer_ownership: int = 60000000, gas_limit_freeze_single_nft: int = 60000000, gas_limit_unfreeze_single_nft: int = 60000000, gas_limit_change_sft_to_meta_esdt: int = 60000000, gas_limit_transfer_nft_create_role: int = 60000000, gas_limit_stop_nft_create: int = 60000000, gas_limit_wipe_single_nft: int = 60000000, gas_limit_esdt_nft_add_uri: int = 10000000, esdt_contract_address: multiversx_sdk.core.address.Address = <factory>, gas_limit_stake: int = 5000000, gas_limit_unstake: int = 5000000, gas_limit_unbond: int = 5000000, gas_limit_create_delegation_contract: int = 50000000, gas_limit_delegation_operations: int = 1000000, additional_gas_limit_per_validator_node: int = 6000000, additional_gas_for_delegation_operations: int = 10000000, gas_limit_esdt_transfer: int = 200000, gas_limit_esdt_nft_transfer: int = 200000, gas_limit_multi_esdt_nft_transfer: int = 200000, gas_limit_save_key_value: int = 100000, gas_limit_persist_per_byte: int = 1000, gas_limit_set_guardian: int = 250000, gas_limit_guard_account: int = 250000, gas_limit_unguard_account: int = 250000, gas_limit_claim_developer_rewards: int = 6000000, gas_limit_change_owner_address: int = 6000000)[source]

Bases: object

additional_gas_for_delegation_operations: int = 10000000
additional_gas_limit_per_validator_node: int = 6000000
address_hrp: str = 'erd'
chain_id: str
esdt_contract_address: Address
gas_limit_change_owner_address: int = 6000000
gas_limit_change_sft_to_meta_esdt: int = 60000000
gas_limit_claim_developer_rewards: int = 6000000
gas_limit_create_delegation_contract: int = 50000000
gas_limit_delegation_operations: int = 1000000
gas_limit_esdt_local_burn: int = 300000
gas_limit_esdt_local_mint: int = 300000
gas_limit_esdt_metadata_update: int = 60000000
gas_limit_esdt_modify_creator: int = 60000000
gas_limit_esdt_modify_royalties: int = 60000000
gas_limit_esdt_nft_add_quantity: int = 1000000
gas_limit_esdt_nft_add_uri: int = 10000000
gas_limit_esdt_nft_burn: int = 1000000
gas_limit_esdt_nft_create: int = 3000000
gas_limit_esdt_nft_transfer: int = 200000
gas_limit_esdt_nft_update_attributes: int = 1000000
gas_limit_esdt_transfer: int = 200000
gas_limit_freeze_single_nft: int = 60000000
gas_limit_freezing: int = 60000000
gas_limit_guard_account: int = 250000
gas_limit_issue: int = 60000000
gas_limit_multi_esdt_nft_transfer: int = 200000
gas_limit_nft_change_to_dynamic: int = 60000000
gas_limit_nft_metadata_recreate: int = 60000000
gas_limit_pausing: int = 60000000
gas_limit_per_byte: int = 1500
gas_limit_persist_per_byte: int = 1000
gas_limit_register_dynamic: int = 60000000
gas_limit_save_key_value: int = 100000
gas_limit_set_guardian: int = 250000
gas_limit_set_new_uris: int = 60000000
gas_limit_set_special_role: int = 60000000
gas_limit_stake: int = 5000000
gas_limit_stop_nft_create: int = 60000000
gas_limit_store_per_byte: int = 10000
gas_limit_toggle_burn_role_globally: int = 60000000
gas_limit_transfer_nft_create_role: int = 60000000
gas_limit_transfer_ownership: int = 60000000
gas_limit_unbond: int = 5000000
gas_limit_unfreeze_single_nft: int = 60000000
gas_limit_unguard_account: int = 250000
gas_limit_unstake: int = 5000000
gas_limit_update_token_id: int = 60000000
gas_limit_wipe_single_nft: int = 60000000
gas_limit_wiping: int = 60000000
issue_cost: int = 50000000000000000
min_gas_limit: int = 50000
class multiversx_sdk.TransferTransactionsFactory(config: TransactionsFactoryConfig)[source]

Bases: object

create_transaction_for_esdt_token_transfer(sender: Address, receiver: Address, token_transfers: list[TokenTransfer]) Transaction[source]
create_transaction_for_native_token_transfer(sender: Address, receiver: Address, native_amount: int, data: str | None = None) Transaction[source]
create_transaction_for_transfer(sender: Address, receiver: Address, native_amount: int | None = None, token_transfers: list[TokenTransfer] | None = None, data: bytes | None = None) Transaction[source]
class multiversx_sdk.TransfersController(chain_id: str)[source]

Bases: object

create_transaction_for_esdt_token_transfer(sender: IAccount, nonce: int, receiver: Address, token_transfers: list[TokenTransfer], guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_native_token_transfer(sender: IAccount, nonce: int, receiver: Address, native_transfer_amount: int = 0, data: bytes | None = None, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
create_transaction_for_transfer(sender: IAccount, nonce: int, receiver: Address, native_transfer_amount: int | None = None, token_transfers: list[TokenTransfer] | None = None, data: bytes | None = None, guardian: Address | None = None, relayer: Address | None = None) Transaction[source]
class multiversx_sdk.UnFreezeOutcome(user_address: multiversx_sdk.core.address.Address, token_identifier: str, nonce: int, balance: int)[source]

Bases: object

balance: int
nonce: int
token_identifier: str
user_address: Address
class multiversx_sdk.UnPauseOutcome(token_identifier: str)[source]

Bases: object

token_identifier: str
class multiversx_sdk.UpdateAttributesOutcome(token_identifier: str, nonce: int, attributes: bytes)[source]

Bases: object

attributes: bytes
nonce: int
token_identifier: str
class multiversx_sdk.UserPEM(label: str, secret_key: UserSecretKey)[source]

Bases: object

classmethod from_file(path: Path, index: int = 0) UserPEM[source]
classmethod from_file_all(path: Path) list[UserPEM][source]
classmethod from_text(text: str, index: int = 0) UserPEM[source]
classmethod from_text_all(text: str) list[UserPEM][source]
save(path: Path)[source]
to_text() str[source]
class multiversx_sdk.UserPublicKey(buffer: bytes)[source]

Bases: object

get_bytes() bytes[source]
hex() str[source]
to_address(hrp: str | None = None) Address[source]
verify(data: bytes, signature: bytes) bool[source]
class multiversx_sdk.UserSecretKey(buffer: bytes)[source]

Bases: object

classmethod generate() UserSecretKey[source]
generate_public_key() UserPublicKey[source]
get_bytes() bytes[source]
hex() str[source]
classmethod new_from_string(buffer_hex: str) UserSecretKey[source]
sign(data: bytes) bytes[source]
class multiversx_sdk.UserSigner(secret_key: UserSecretKey)[source]

Bases: object

ed25519 signer

classmethod from_pem_file(path: Path, index: int = 0) UserSigner[source]
classmethod from_pem_file_all(path: Path) list[UserSigner][source]
classmethod from_wallet(path: Path, password: str) UserSigner[source]
get_pubkey() UserPublicKey[source]
sign(data: bytes) bytes[source]
class multiversx_sdk.UserVerifier(public_key: UserPublicKey)[source]

Bases: object

classmethod from_address(address: Address) UserVerifier[source]
verify(data: bytes, signature: bytes) bool[source]
class multiversx_sdk.UserWallet(kind: str, encrypted_data: EncryptedData, public_key_when_kind_is_secret_key: UserPublicKey | None = None)[source]

Bases: object

Do not use this constructor directly. Use the static methods from_secret_key() and from_mnemonic() instead.

classmethod decrypt_mnemonic(keyfile_object: dict[str, Any], password: str) Mnemonic[source]
classmethod decrypt_secret_key(keyfile_object: dict[str, Any], password: str) UserSecretKey[source]
classmethod from_mnemonic(mnemonic: str, password: str, randomness: IRandomness | None = None) UserWallet[source]
classmethod from_secret_key(secret_key: UserSecretKey, password: str, randomness: IRandomness | None = None) UserWallet[source]
classmethod load_secret_key(path: Path, password: str, address_index: int | None = None) UserSecretKey[source]

Loads a secret key from a keystore file.

Parameters:
  • path – The path to the keystore file.

  • password – The password to decrypt the keystore file.

  • address_index – The index of the address to load. This is only used when the keystore file contains a mnemonic, and the secret key has to be derived from this mnemonic.

save(path: Path, address_hrp: str | None = None)[source]
to_dict(address_hrp: str | None = None) dict[str, Any][source]
to_json(address_hrp: str | None = None) str[source]
class multiversx_sdk.ValidatorPEM(label: str, secret_key: ValidatorSecretKey)[source]

Bases: object

classmethod from_file(path: Path, index: int = 0) ValidatorPEM[source]
classmethod from_file_all(path: Path) list[ValidatorPEM][source]
classmethod from_text(text: str, index: int = 0) ValidatorPEM[source]
classmethod from_text_all(text: str) list[ValidatorPEM][source]
save(path: Path)[source]
to_text()[source]
class multiversx_sdk.ValidatorPublicKey(buffer: bytes)[source]

Bases: object

classmethod from_string(buffer_hex: str) ValidatorPublicKey[source]
hex() str[source]
verify(data: bytes, signature: bytes) bool[source]
class multiversx_sdk.ValidatorSecretKey(buffer: bytes)[source]

Bases: object

classmethod from_string(buffer_hex: str) ValidatorSecretKey[source]
classmethod generate() ValidatorSecretKey[source]
generate_public_key() ValidatorPublicKey[source]
hex() str[source]
sign(data: bytes) bytes[source]
class multiversx_sdk.ValidatorSigner(secret_key: ValidatorSecretKey)[source]

Bases: object

Validator signer (BLS signer)

classmethod from_pem_file(path: Path, index: int = 0) ValidatorSigner[source]
get_pubkey() ValidatorPublicKey[source]
sign(data: bytes) bytes[source]
class multiversx_sdk.ValidatorVerifier(public_key: ValidatorPublicKey)[source]

Bases: object

classmethod from_string(buffer_hex: str) ValidatorVerifier[source]
verify(data: bytes, signature: bytes) bool[source]
class multiversx_sdk.WipeOutcome(user_address: multiversx_sdk.core.address.Address, token_identifier: str, nonce: int, balance: int)[source]

Bases: object

balance: int
nonce: int
token_identifier: str
user_address: Address
multiversx_sdk.find_events_by_first_topic(transaction: TransactionOnNetwork, topic: str) list[TransactionEvent][source]
multiversx_sdk.find_events_by_identifier(transaction: TransactionOnNetwork, identifier: str) list[TransactionEvent][source]