multiversx_sdk.core package

Subpackages

Submodules

multiversx_sdk.core.address module

class multiversx_sdk.core.address.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.core.address.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.core.address.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

multiversx_sdk.core.address.get_shard_of_pubkey(pubkey: bytes, number_of_shards: int) int[source]
multiversx_sdk.core.address.is_valid_bech32(value: str, expected_hrp: str) bool[source]

multiversx_sdk.core.bech32 module

Reference implementation for Bech32 and segwit addresses.

multiversx_sdk.core.bech32.bech32_create_checksum(hrp: str, data: List[int])[source]

Compute the checksum values given HRP and data.

multiversx_sdk.core.bech32.bech32_decode(bech: str)[source]

Validate a Bech32 string, and determine HRP and data.

multiversx_sdk.core.bech32.bech32_encode(hrp: str, data: List[int])[source]

Compute a Bech32 string given HRP and data values.

multiversx_sdk.core.bech32.bech32_hrp_expand(hrp: str) List[int][source]

Expand the HRP into values for checksum computation.

multiversx_sdk.core.bech32.bech32_polymod(values: List[int])[source]

Internal function that computes the Bech32 checksum.

multiversx_sdk.core.bech32.bech32_verify_checksum(hrp: str, data: List[int])[source]

Verify a checksum given HRP and converted data characters.

multiversx_sdk.core.bech32.convertbits(data: List[int] | bytes, frombits: int, tobits: int, pad: bool = True) List[int] | None[source]

General power-of-2 base conversion.

multiversx_sdk.core.bech32.decode(hrp: str, addr: str)[source]

Decode a segwit address.

multiversx_sdk.core.bech32.encode(hrp: str, witver: int, witprog: List[int])[source]

Encode a segwit address.

multiversx_sdk.core.code_metadata module

class multiversx_sdk.core.code_metadata.ByteOne(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Payable = 2
PayableByContract = 4
Reserved1 = 1
class multiversx_sdk.core.code_metadata.ByteZero(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Readable = 4
Reserved2 = 2
Upgradeable = 1
class multiversx_sdk.core.code_metadata.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]

multiversx_sdk.core.config module

class multiversx_sdk.core.config.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'

multiversx_sdk.core.errors module

exception multiversx_sdk.core.errors.BadAddressError(address: Any)[source]

Bases: Exception

exception multiversx_sdk.core.errors.BadPubkeyLengthError(actual: int, expected: int)[source]

Bases: Exception

exception multiversx_sdk.core.errors.BadUsageError(message: str)[source]

Bases: Exception

exception multiversx_sdk.core.errors.InvalidTokenIdentifierError(message: str)[source]

Bases: Exception

exception multiversx_sdk.core.errors.NotEnoughGasError(gas_limit: int)[source]

Bases: Exception

exception multiversx_sdk.core.errors.ParseTransactionOnNetworkError(message: str)[source]

Bases: Exception

multiversx_sdk.core.interfaces module

class multiversx_sdk.core.interfaces.IAccount(*args, **kwargs)[source]

Bases: Protocol

property address: Address
sign(data: bytes) bytes[source]
class multiversx_sdk.core.interfaces.INetworkConfig(*args, **kwargs)[source]

Bases: Protocol

gas_per_data_byte: int
gas_price_modifier: float
min_gas_limit: int

multiversx_sdk.core.message module

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

Bases: object

class multiversx_sdk.core.message.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]

multiversx_sdk.core.tokens module

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

Bases: object

class multiversx_sdk.core.tokens.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.core.tokens.TokenIdentifierParts(ticker: str, random_sequence: str, nonce: int, prefix: str | None = None)[source]

Bases: object

class multiversx_sdk.core.tokens.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]

multiversx_sdk.core.transaction module

class multiversx_sdk.core.transaction.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]

multiversx_sdk.core.transaction_computer module

class multiversx_sdk.core.transaction_computer.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]

multiversx_sdk.core.transaction_events_parser module

class multiversx_sdk.core.transaction_events_parser.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]

multiversx_sdk.core.transaction_on_network module

class multiversx_sdk.core.transaction_on_network.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.core.transaction_on_network.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.core.transaction_on_network.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.core.transaction_on_network.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
multiversx_sdk.core.transaction_on_network.find_events_by_first_topic(transaction: TransactionOnNetwork, topic: str) list[TransactionEvent][source]
multiversx_sdk.core.transaction_on_network.find_events_by_identifier(transaction: TransactionOnNetwork, identifier: str) list[TransactionEvent][source]
multiversx_sdk.core.transaction_on_network.find_events_by_predicate(transaction: TransactionOnNetwork, predicate: Callable[[TransactionEvent], bool]) list[TransactionEvent][source]
multiversx_sdk.core.transaction_on_network.gather_all_events(transaction: TransactionOnNetwork) list[TransactionEvent][source]

multiversx_sdk.core.transaction_status module

class multiversx_sdk.core.transaction_status.TransactionStatus(status: str)[source]

Bases: object

is_completed: bool
is_successful: bool
status: str

multiversx_sdk.core.transactions_factory_config module

class multiversx_sdk.core.transactions_factory_config.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

Module contents

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

Bases: object

class multiversx_sdk.core.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.core.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.core.Token(identifier: str, nonce: int = 0)[source]

Bases: object

class multiversx_sdk.core.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.core.TokenIdentifierParts(ticker: str, random_sequence: str, nonce: int, prefix: str | None = None)[source]

Bases: object

class multiversx_sdk.core.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.core.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.core.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.core.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.core.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.core.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.core.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.core.TransactionStatus(status: str)[source]

Bases: object

is_completed: bool
is_successful: bool
status: str
class multiversx_sdk.core.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
multiversx_sdk.core.find_events_by_first_topic(transaction: TransactionOnNetwork, topic: str) list[TransactionEvent][source]
multiversx_sdk.core.find_events_by_identifier(transaction: TransactionOnNetwork, identifier: str) list[TransactionEvent][source]