diff --git a/docs/conf.py b/docs/conf.py index 0adc30bc..614e6e1f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,7 @@ project = 'multiversx-sdk' copyright = '2024, MultiversX' author = 'MultiversX' -release = '0.11.0' +release = '0.19.0' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/docs/multiversx_sdk.abi.rst b/docs/multiversx_sdk.abi.rst index a1a0cf32..0b61e614 100644 --- a/docs/multiversx_sdk.abi.rst +++ b/docs/multiversx_sdk.abi.rst @@ -68,6 +68,14 @@ multiversx\_sdk.abi.bytes\_value module :undoc-members: :show-inheritance: +multiversx\_sdk.abi.code\_metadata\_value module +------------------------------------------------ + +.. automodule:: multiversx_sdk.abi.code_metadata_value + :members: + :undoc-members: + :show-inheritance: + multiversx\_sdk.abi.codec module -------------------------------- @@ -92,6 +100,14 @@ multiversx\_sdk.abi.enum\_value module :undoc-members: :show-inheritance: +multiversx\_sdk.abi.explicit\_enum\_value module +------------------------------------------------ + +.. automodule:: multiversx_sdk.abi.explicit_enum_value + :members: + :undoc-members: + :show-inheritance: + multiversx\_sdk.abi.fields module --------------------------------- diff --git a/docs/multiversx_sdk.core.rst b/docs/multiversx_sdk.core.rst index e225cf6a..f164ad2f 100644 --- a/docs/multiversx_sdk.core.rst +++ b/docs/multiversx_sdk.core.rst @@ -56,6 +56,14 @@ multiversx\_sdk.core.codec module :undoc-members: :show-inheritance: +multiversx\_sdk.core.config module +---------------------------------- + +.. automodule:: multiversx_sdk.core.config + :members: + :undoc-members: + :show-inheritance: + multiversx\_sdk.core.contract\_query module ------------------------------------------- diff --git a/docs/multiversx_sdk.network_providers.rst b/docs/multiversx_sdk.network_providers.rst index 60b116d2..651d7f9b 100644 --- a/docs/multiversx_sdk.network_providers.rst +++ b/docs/multiversx_sdk.network_providers.rst @@ -188,6 +188,14 @@ multiversx\_sdk.network\_providers.transactions module :undoc-members: :show-inheritance: +multiversx\_sdk.network\_providers.user\_agent module +----------------------------------------------------- + +.. automodule:: multiversx_sdk.network_providers.user_agent + :members: + :undoc-members: + :show-inheritance: + multiversx\_sdk.network\_providers.utils module ----------------------------------------------- diff --git a/examples/Cookbook.ipynb b/examples/Cookbook.ipynb index 264230b5..7e124ed7 100644 --- a/examples/Cookbook.ipynb +++ b/examples/Cookbook.ipynb @@ -184,6 +184,47 @@ "print(\"Is contract:\", address.is_smart_contract())" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Changing the default hrp\n", + "\n", + "We have a configuration class, called `LibraryConfig`, that only stores the **default hrp** of the addresses. The default value is `erd`. The hrp can be changed when instantiating an address, or it can be changed in the `LibraryConfig` class, and all the addresses created will have the newly set hrp. " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "erd\n", + "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th\n", + "test1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ss5hqhtr\n" + ] + } + ], + "source": [ + "from multiversx_sdk import Address\n", + "from multiversx_sdk import LibraryConfig\n", + "\n", + "\n", + "print(LibraryConfig.default_address_hrp)\n", + "address = Address.new_from_hex(\"0139472eff6886771a982f3083da5d421f24c29181e63888228dc81ca60d69e1\")\n", + "print(address.to_bech32())\n", + "\n", + "LibraryConfig.default_address_hrp = \"test\"\n", + "address = Address.new_from_hex(\"0139472eff6886771a982f3083da5d421f24c29181e63888228dc81ca60d69e1\")\n", + "print(address.to_bech32())\n", + "\n", + "# setting back the default value\n", + "LibraryConfig.default_address_hrp = \"erd\"" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -2249,7 +2290,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.12.3" }, "orig_nbformat": 4, "vscode": { diff --git a/multiversx_sdk/__init__.py b/multiversx_sdk/__init__.py index 6768a1e0..2e53e346 100644 --- a/multiversx_sdk/__init__.py +++ b/multiversx_sdk/__init__.py @@ -5,6 +5,7 @@ from multiversx_sdk.core.address import (Address, AddressComputer, AddressFactory) from multiversx_sdk.core.code_metadata import CodeMetadata +from multiversx_sdk.core.config import LibraryConfig from multiversx_sdk.core.contract_query import ContractQuery from multiversx_sdk.core.contract_query_builder import ContractQueryBuilder from multiversx_sdk.core.message import Message, MessageComputer @@ -84,5 +85,6 @@ "UserWallet", "UserPEM", "QueryRunnerAdapter", "TransactionsConverter", "DelegationTransactionsOutcomeParser", "find_events_by_identifier", "find_events_by_first_topic", "SmartContractTransactionsOutcomeParser", "TransactionAwaiter", "SmartContractQueriesController", "SmartContractQuery", "SmartContractQueryResponse", - "TransactionDecoder", "TransactionMetadata", "TransactionEventsParser", "NetworkProviderConfig" + "TransactionDecoder", "TransactionMetadata", "TransactionEventsParser", "NetworkProviderConfig", + "LibraryConfig" ] diff --git a/multiversx_sdk/core/__init__.py b/multiversx_sdk/core/__init__.py index ea91361c..85a59643 100644 --- a/multiversx_sdk/core/__init__.py +++ b/multiversx_sdk/core/__init__.py @@ -2,6 +2,7 @@ from multiversx_sdk.core.address import (Address, AddressComputer, AddressFactory) from multiversx_sdk.core.code_metadata import CodeMetadata +from multiversx_sdk.core.config import LibraryConfig from multiversx_sdk.core.contract_query import ContractQuery from multiversx_sdk.core.contract_query_builder import ContractQueryBuilder from multiversx_sdk.core.message import Message, MessageComputer @@ -54,5 +55,6 @@ "SmartContractTransactionsFactory", "TransferTransactionsFactory", "RelayedTransactionsFactory", "AccountTransactionsFactory", "DelegationTransactionsOutcomeParser", "find_events_by_identifier", "find_events_by_first_topic", "SmartContractTransactionsOutcomeParser", - "SmartContractQueriesController", "SmartContractQuery", "SmartContractQueryResponse", "TransactionEventsParser" + "SmartContractQueriesController", "SmartContractQuery", "SmartContractQueryResponse", "TransactionEventsParser", + "LibraryConfig" ] diff --git a/pyproject.toml b/pyproject.toml index ed92d33a..d7c8b60c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ allow-direct-references = true [project] name = "multiversx-sdk" -version = "0.18.0" +version = "0.19.0" authors = [ { name="MultiversX" }, ]