diff --git a/dkg/asset.py b/dkg/asset.py index 08d6fd1..ad002ec 100644 --- a/dkg/asset.py +++ b/dkg/asset.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. +import json import math import re from typing import Literal, Type @@ -23,17 +24,28 @@ from web3 import Web3 from web3.constants import ADDRESS_ZERO, HASH_ZERO from web3.exceptions import ContractLogicError - -from dkg.constants import (DEFAULT_HASH_FUNCTION_ID, DEFAULT_SCORE_FUNCTION_ID, - PRIVATE_ASSERTION_PREDICATE, - PRIVATE_CURRENT_REPOSITORY, - PRIVATE_HISTORICAL_REPOSITORY) -from dkg.dataclasses import (KnowledgeAssetContentVisibility, - KnowledgeAssetEnumStates, NodeResponseDict) -from dkg.exceptions import (DatasetOutputFormatNotSupported, - InvalidKnowledgeAsset, InvalidStateOption, - InvalidTokenAmount, MissingKnowledgeAssetState, - OperationNotFinished) +from web3.types import TxReceipt + +from dkg.constants import ( + DEFAULT_HASH_FUNCTION_ID, + DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS, + PRIVATE_ASSERTION_PREDICATE, + PRIVATE_CURRENT_REPOSITORY, + PRIVATE_HISTORICAL_REPOSITORY, +) +from dkg.dataclasses import ( + KnowledgeAssetContentVisibility, + KnowledgeAssetEnumStates, + NodeResponseDict, +) +from dkg.exceptions import ( + DatasetOutputFormatNotSupported, + InvalidKnowledgeAsset, + InvalidStateOption, + InvalidTokenAmount, + MissingKnowledgeAssetState, + OperationNotFinished, +) from dkg.manager import DefaultRequestManager from dkg.method import Method from dkg.module import Module @@ -41,10 +53,17 @@ from dkg.utils.blockchain_request import BlockchainRequest from dkg.utils.decorators import retry from dkg.utils.merkle import MerkleTree, hash_assertion_with_indexes -from dkg.utils.metadata import (generate_agreement_id, - generate_assertion_metadata, generate_keyword) -from dkg.utils.node_request import (NodeRequest, StoreTypes, - validate_operation_status) +from dkg.utils.metadata import ( + generate_agreement_id, + generate_assertion_metadata, + generate_keyword, +) +from dkg.utils.node_request import ( + NodeRequest, + OperationStatus, + StoreTypes, + validate_operation_status, +) from dkg.utils.rdf import format_content, normalize_dataset from dkg.utils.ual import format_ual, parse_ual @@ -188,7 +207,7 @@ def create( token_amount: Wei | None = None, immutable: bool = False, content_type: Literal["JSON-LD", "N-Quads"] = "JSON-LD", - ) -> dict[str, HexStr | dict[str, str]]: + ) -> dict[str, UAL | HexStr | dict[str, dict[str, str] | TxReceipt]]: blockchain_id = self.manager.blockchain_provider.blockchain_id assertions = format_content(content, content_type) @@ -218,8 +237,10 @@ def create( if is_allowance_increased := current_allowance < token_amount: self.increase_allowance(token_amount) + result = {"publicAssertionId": public_assertion_id, "operation": {}} + try: - receipt = self._create( + receipt: TxReceipt = self._create( { "assertionId": Web3.to_bytes(hexstr=public_assertion_id), "size": public_assertion_metadata["size"], @@ -227,7 +248,9 @@ def create( "chunksNumber": public_assertion_metadata["chunks_number"], "tokenAmount": token_amount, "epochsNumber": epochs_number, - "scoreFunctionId": DEFAULT_SCORE_FUNCTION_ID, + "scoreFunctionId": DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS[ + self.manager.blockchain_provider.environment + ][blockchain_id], "immutable_": immutable, } ) @@ -243,6 +266,11 @@ def create( ) token_id = events[0].args["tokenId"] + result["UAL"] = format_ual( + blockchain_id, content_asset_storage_address, token_id + ) + result["operation"]["mintKnowledgeAsset"] = json.loads(Web3.to_json(receipt)) + assertions_list = [ { "blockchain": blockchain_id, @@ -269,9 +297,6 @@ def create( } ) - operation_id = self._local_store(assertions_list)["operationId"] - self.get_operation_result(operation_id, "local-store") - operation_id = self._publish( public_assertion_id, assertions["public"], @@ -282,14 +307,21 @@ def create( )["operationId"] operation_result = self.get_operation_result(operation_id, "publish") - return { - "UAL": format_ual(blockchain_id, content_asset_storage_address, token_id), - "publicAssertionId": public_assertion_id, - "operation": { + result["operation"]["publish"] = { + "operationId": operation_id, + "status": operation_result["status"], + } + + if operation_result["status"] == OperationStatus.COMPLETED: + operation_id = self._local_store(assertions_list)["operationId"] + operation_result = self.get_operation_result(operation_id, "local-store") + + result["operation"]["localStore"] = { "operationId": operation_id, "status": operation_result["status"], - }, - } + } + + return result _transfer = Method(BlockchainRequest.transfer_asset) @@ -297,10 +329,10 @@ def transfer( self, ual: UAL, new_owner: Address, - ) -> dict[str, UAL | Address | dict[str, str]]: + ) -> dict[str, UAL | Address | TxReceipt]: token_id = parse_ual(ual)["token_id"] - self._transfer( + receipt: TxReceipt = self._transfer( self.manager.blockchain_provider.account, new_owner, token_id, @@ -309,7 +341,7 @@ def transfer( return { "UAL": ual, "owner": new_owner, - "operation": {"status": "COMPLETED"}, + "operation": json.loads(Web3.to_json(receipt)), } _update = Method(NodeRequest.update) @@ -325,7 +357,7 @@ def update( content: dict[Literal["public", "private"], JSONLD], token_amount: Wei | None = None, content_type: Literal["JSON-LD", "N-Quads"] = "JSON-LD", - ) -> dict[str, HexStr | dict[str, str]]: + ) -> dict[str, UAL | HexStr | dict[str, str]]: parsed_ual = parse_ual(ual) blockchain_id, content_asset_storage_address, token_id = ( parsed_ual["blockchain"], @@ -438,24 +470,24 @@ def update( _cancel_update = Method(BlockchainRequest.cancel_asset_state_update) - def cancel_update(self, ual: UAL) -> dict[str, UAL | dict[str, str]]: + def cancel_update(self, ual: UAL) -> dict[str, UAL | TxReceipt]: token_id = parse_ual(ual)["token_id"] - self._cancel_update(token_id) + receipt: TxReceipt = self._cancel_update(token_id) return { "UAL": ual, - "operation": {"status": "COMPLETED"}, + "operation": json.loads(Web3.to_json(receipt)), } _burn_asset = Method(BlockchainRequest.burn_asset) - def burn(self, ual: UAL) -> dict[str, UAL | dict[str, str]]: + def burn(self, ual: UAL) -> dict[str, UAL | TxReceipt]: token_id = parse_ual(ual)["token_id"] - self._burn_asset(token_id) + receipt: TxReceipt = self._burn_asset(token_id) - return {"UAL": ual, "operation": {"status": "COMPLETED"}} + return {"UAL": ual, "operation": json.loads(Web3.to_json(receipt))} _get_assertion_ids = Method(BlockchainRequest.get_assertion_ids) _get_latest_assertion_id = Method(BlockchainRequest.get_latest_assertion_id) @@ -471,7 +503,7 @@ def get( content_visibility: str = KnowledgeAssetContentVisibility.ALL.value, output_format: Literal["JSON-LD", "N-Quads"] = "JSON-LD", validate: bool = True, - ) -> dict[str, HexStr | list[JSONLD] | dict[str, str]]: + ) -> dict[str, UAL | HexStr | list[JSONLD] | dict[str, str]]: state = ( state.upper() if (isinstance(state, str) and not re.match(r"^0x[a-fA-F0-9]{64}$", state)) @@ -697,7 +729,7 @@ def extend_storing_period( ual: UAL, additional_epochs: int, token_amount: Wei | None = None, - ) -> dict[str, UAL | dict[str, str]]: + ) -> dict[str, UAL | TxReceipt]: parsed_ual = parse_ual(ual) blockchain_id, content_asset_storage_address, token_id = ( parsed_ual["blockchain"], @@ -722,11 +754,13 @@ def extend_storing_period( )["bidSuggestion"] ) - self._extend_storing_period(token_id, additional_epochs, token_amount) + receipt: TxReceipt = self._extend_storing_period( + token_id, additional_epochs, token_amount + ) return { "UAL": ual, - "operation": {"status": "COMPLETED"}, + "operation": json.loads(Web3.to_json(receipt)), } _get_assertion_size = Method(BlockchainRequest.get_assertion_size) @@ -736,7 +770,7 @@ def add_tokens( self, ual: UAL, token_amount: Wei | None = None, - ) -> dict[str, UAL | dict[str, str]]: + ) -> dict[str, UAL | TxReceipt]: parsed_ual = parse_ual(ual) blockchain_id, content_asset_storage_address, token_id = ( parsed_ual["blockchain"], @@ -782,11 +816,11 @@ def add_tokens( "more tokens!" ) - self._add_tokens(token_id, token_amount) + receipt: TxReceipt = self._add_tokens(token_id, token_amount) return { "UAL": ual, - "operation": {"status": "COMPLETED"}, + "operation": json.loads(Web3.to_json(receipt)), } _add_update_tokens = Method(BlockchainRequest.increase_asset_update_token_amount) @@ -795,7 +829,7 @@ def add_update_tokens( self, ual: UAL, token_amount: Wei | None = None, - ) -> dict[str, UAL | dict[str, str]]: + ) -> dict[str, UAL | TxReceipt]: parsed_ual = parse_ual(ual) blockchain_id, content_asset_storage_address, token_id = ( parsed_ual["blockchain"], @@ -839,11 +873,11 @@ def add_update_tokens( "more update tokens!" ) - self._add_update_tokens(token_id, token_amount) + receipt: TxReceipt = self._add_update_tokens(token_id, token_amount) return { "UAL": ual, - "operation": {"status": "COMPLETED"}, + "operation": json.loads(Web3.to_json(receipt)), } def get_owner(self, ual: UAL) -> Address: diff --git a/dkg/constants.py b/dkg/constants.py index 946b5cb..080b78c 100644 --- a/dkg/constants.py +++ b/dkg/constants.py @@ -61,13 +61,42 @@ "hub": "0x5fA7916c48Fe6D5F1738d12Ad234b78c90B4cAdA", "rpc": "https://astrosat-parachain-rpc.origin-trail.network", }, + "gnosis:100": { + "hub": "0xbEF14fc04F870c2dD65c13Df4faB6ba01A9c746b", + "rpc": "https://rpc.gnosischain.com/", + "gas_price_oracle": [ + "https://api.gnosisscan.io/api?module=proxy&action=eth_gasPrice", + "https://blockscout.com/xdai/mainnet/api/v1/gas-price-oracle", + ], + } }, } -DEFAULT_GAS_PRICE_GWEI = 100 +DEFAULT_GAS_PRICE_GWEI = { + "gnosis": 20, + "otp": 1, +} DEFAULT_HASH_FUNCTION_ID = 1 -DEFAULT_SCORE_FUNCTION_ID = 1 +DEFAULT_PROXIMITY_SCORE_FUNCTIONS_PAIR_IDS = { + "development": { + "hardhat1:31337": 1, + "hardhat2:31337": 2, + "otp:2043": 1 + }, + "devnet": { + "otp:2160": 1, + "gnosis:10200": 2, + }, + "testnet": { + "otp:20430": 1, + "gnosis:10200": 2, + }, + "mainnet": { + "otp:2043": 1, + "gnosis:100": 2, + }, +} PRIVATE_HISTORICAL_REPOSITORY = "privateHistory" PRIVATE_CURRENT_REPOSITORY = "privateCurrent" diff --git a/dkg/providers/blockchain.py b/dkg/providers/blockchain.py index 41f1ddb..8bcc683 100644 --- a/dkg/providers/blockchain.py +++ b/dkg/providers/blockchain.py @@ -28,7 +28,6 @@ NetworkNotSupported, RPCURINotDefined) from dkg.types import URI, Address, DataHexStr, Environment, Wei from eth_account.signers.local import LocalAccount -from requests.exceptions import ConnectionError, HTTPError, RequestException, Timeout from web3 import Web3 from web3.contract import Contract from web3.contract.contract import ContractFunction @@ -162,11 +161,9 @@ def call_function( "account." ) - nonce = self.w3.eth.get_transaction_count(self.w3.eth.default_account) gas_price = self.gas_price or gas_price or self._get_network_gas_price() options = { - "nonce": nonce, "gasPrice": gas_price, "gas": gas_limit or contract_function(**args).estimate_gas(), } @@ -192,45 +189,40 @@ def set_account(self, private_key: DataHexStr): ) self.w3.eth.default_account = self.account.address - def _get_network_gas_price(self) -> int | None: - blockchain_name, chain_id = self.blockchain_id.split(":") - - default_gas_price = self.w3.to_wei(DEFAULT_GAS_PRICE_GWEI, "gwei") - - match blockchain_name: - case "otp": - return self.w3.eth.gas_price - case "gnosis": - if self.gas_price_oracle is None: - return default_gas_price - - try: - response = requests.get(self.gas_price_oracle) - - response.raise_for_status() - - try: - response_json: dict = response.json() - except ValueError: - return default_gas_price - - except (HTTPError, ConnectionError, Timeout, RequestException): - return default_gas_price - - gas_price = None - match chain_id: - case "100": - gas_price_hex = response_json.get("result") - if gas_price_hex: - gas_price = int(gas_price_hex, 16) - case "10200": - gas_price_avg = response_json.get("average") - if gas_price_avg: - gas_price = self.w3.to_wei(gas_price_avg, "gwei") - - return gas_price if gas_price is not None else default_gas_price - case _: - return default_gas_price + def _get_network_gas_price(self) -> Wei | None: + blockchain_name, _ = self.blockchain_id.split(":") + + default_gas_price = self.w3.to_wei( + DEFAULT_GAS_PRICE_GWEI[blockchain_name], + "gwei" + ) + + def fetch_gas_price(oracle_url: str) -> Wei | None: + try: + response = requests.get(oracle_url) + response.raise_for_status() + data: dict = response.json() + + if "result" in data: + return int(data['result'], 16) + elif "average" in data: + return self.w3.to_wei(data['average'], 'gwei') + else: + return None + except Exception: + return None + + oracles = self.gas_price_oracle + if oracles is not None: + if isinstance(oracles, str): + oracles = [oracles] + + for oracle_url in oracles: + gas_price = fetch_gas_price(oracle_url) + if gas_price is not None: + return gas_price + + return default_gas_price def _init_contracts(self): for contract in self.abi.keys(): diff --git a/poetry.lock b/poetry.lock index af16220..677c8aa 100644 --- a/poetry.lock +++ b/poetry.lock @@ -493,13 +493,13 @@ cython = ["cython"] [[package]] name = "eth-abi" -version = "4.2.1" +version = "5.0.1" description = "eth_abi: Python utilities for working with Ethereum ABI definitions, especially encoding and decoding" optional = false -python-versions = ">=3.7.2, <4" +python-versions = ">=3.8, <4" files = [ - {file = "eth_abi-4.2.1-py3-none-any.whl", hash = "sha256:abd83410a5326145bf178675c276de0ed154f6dc695dcad1beafaa44d97f44ae"}, - {file = "eth_abi-4.2.1.tar.gz", hash = "sha256:60d88788d53725794cdb07c0f0bb0df2a31a6e1ad19644313fe6117ac24eeeb0"}, + {file = "eth_abi-5.0.1-py3-none-any.whl", hash = "sha256:521960d8b4beee514958e1774951dc6b48176aa274e3bd8b166f6921453047ef"}, + {file = "eth_abi-5.0.1.tar.gz", hash = "sha256:e9425110c6120c585c9f0db2e8a33d76c4b886b148a65e68fc0035d3917a3b9c"}, ] [package.dependencies] @@ -508,38 +508,36 @@ eth-utils = ">=2.0.0" parsimonious = ">=0.9.0,<0.10.0" [package.extras] -dev = ["black (>=23)", "build (>=0.9.0)", "bumpversion (>=0.5.3)", "eth-hash[pycryptodome]", "flake8 (==6.0.0)", "flake8-bugbear (==23.3.23)", "hypothesis (>=4.18.2,<5.0.0)", "ipython", "isort (>=5.10.1)", "mypy (==0.971)", "pydocstyle (>=6.0.0)", "pytest (>=7.0.0)", "pytest-pythonpath (>=0.7.1)", "pytest-watch (>=4.1.0)", "pytest-xdist (>=2.4.0)", "sphinx (>=5.0.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)", "tox (>=4.0.0)", "twine", "wheel"] -doc = ["sphinx (>=5.0.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)"] -lint = ["black (>=23)", "flake8 (==6.0.0)", "flake8-bugbear (==23.3.23)", "isort (>=5.10.1)", "mypy (==0.971)", "pydocstyle (>=6.0.0)"] -test = ["eth-hash[pycryptodome]", "hypothesis (>=4.18.2,<5.0.0)", "pytest (>=7.0.0)", "pytest-pythonpath (>=0.7.1)", "pytest-xdist (>=2.4.0)"] +dev = ["build (>=0.9.0)", "bumpversion (>=0.5.3)", "eth-hash[pycryptodome]", "hypothesis (>=4.18.2,<5.0.0)", "ipython", "pre-commit (>=3.4.0)", "pytest (>=7.0.0)", "pytest-pythonpath (>=0.7.1)", "pytest-timeout (>=2.0.0)", "pytest-xdist (>=2.4.0)", "sphinx (>=6.0.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)", "tox (>=4.0.0)", "twine", "wheel"] +docs = ["sphinx (>=6.0.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)"] +test = ["eth-hash[pycryptodome]", "hypothesis (>=4.18.2,<5.0.0)", "pytest (>=7.0.0)", "pytest-pythonpath (>=0.7.1)", "pytest-timeout (>=2.0.0)", "pytest-xdist (>=2.4.0)"] tools = ["hypothesis (>=4.18.2,<5.0.0)"] [[package]] name = "eth-account" -version = "0.8.0" +version = "0.11.0" description = "eth-account: Sign Ethereum transactions and messages with local private keys" optional = false -python-versions = ">=3.6, <4" +python-versions = ">=3.8, <4" files = [ - {file = "eth-account-0.8.0.tar.gz", hash = "sha256:ccb2d90a16c81c8ea4ca4dc76a70b50f1d63cea6aff3c5a5eddedf9e45143eca"}, - {file = "eth_account-0.8.0-py3-none-any.whl", hash = "sha256:0ccc0edbb17021004356ae6e37887528b6e59e6ae6283f3917b9759a5887203b"}, + {file = "eth-account-0.11.0.tar.gz", hash = "sha256:2ffc7a0c7538053a06a7d11495c16c7ad9897dd42be0f64ca7551e9f6e0738c3"}, + {file = "eth_account-0.11.0-py3-none-any.whl", hash = "sha256:76dd261ea096ee09e51455b0a4c99f22185516fdc062f63df0817c28f605e430"}, ] [package.dependencies] -bitarray = ">=2.4.0,<3" -eth-abi = ">=3.0.1" -eth-keyfile = ">=0.6.0,<0.7.0" -eth-keys = ">=0.4.0,<0.5" -eth-rlp = ">=0.3.0,<1" -eth-utils = ">=2.0.0,<3" -hexbytes = ">=0.1.0,<1" -rlp = ">=1.0.0,<4" +bitarray = ">=2.4.0" +eth-abi = ">=4.0.0-b.2" +eth-keyfile = ">=0.6.0" +eth-keys = ">=0.4.0" +eth-rlp = ">=0.3.0" +eth-utils = ">=2.0.0" +hexbytes = ">=0.1.0,<0.4.0" +rlp = ">=1.0.0" [package.extras] -dev = ["Sphinx (>=1.6.5,<5)", "black (>=22,<23)", "bumpversion (>=0.5.3,<1)", "coverage", "flake8 (==3.7.9)", "hypothesis (>=4.18.0,<5)", "ipython", "isort (>=4.2.15,<5)", "jinja2 (>=3.0.0,<3.1.0)", "mypy (==0.910)", "pydocstyle (>=5.0.0,<6)", "pytest (>=6.2.5,<7)", "pytest-watch (>=4.1.0,<5)", "pytest-xdist", "sphinx-rtd-theme (>=0.1.9,<1)", "towncrier (>=21,<22)", "tox (==3.25.0)", "twine", "wheel"] -doc = ["Sphinx (>=1.6.5,<5)", "jinja2 (>=3.0.0,<3.1.0)", "sphinx-rtd-theme (>=0.1.9,<1)", "towncrier (>=21,<22)"] -lint = ["black (>=22,<23)", "flake8 (==3.7.9)", "isort (>=4.2.15,<5)", "mypy (==0.910)", "pydocstyle (>=5.0.0,<6)"] -test = ["coverage", "hypothesis (>=4.18.0,<5)", "pytest (>=6.2.5,<7)", "pytest-xdist", "tox (==3.25.0)"] +dev = ["build (>=0.9.0)", "bumpversion (>=0.5.3)", "coverage", "hypothesis (>=4.18.0,<5)", "ipython", "pre-commit (>=3.4.0)", "pytest (>=7.0.0)", "pytest-xdist (>=2.4.0)", "sphinx (>=6.0.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)", "tox (>=4.0.0)", "twine", "wheel"] +docs = ["sphinx (>=6.0.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)"] +test = ["coverage", "hypothesis (>=4.18.0,<5)", "pytest (>=7.0.0)", "pytest-xdist (>=2.4.0)"] [[package]] name = "eth-hash" @@ -1870,13 +1868,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "web3" -version = "6.10.0" +version = "6.15.1" description = "web3.py" optional = false python-versions = ">=3.7.2" files = [ - {file = "web3-6.10.0-py3-none-any.whl", hash = "sha256:070625a0da4f0fcac090fa95186e0b865a1bbc43efb78fd2ee805f7bf9cd8986"}, - {file = "web3-6.10.0.tar.gz", hash = "sha256:ea89f8a6ee74b74c3ff21954eafe00ec914365adb904c6c374f559bc46d4a61c"}, + {file = "web3-6.15.1-py3-none-any.whl", hash = "sha256:4e4a8313aa4556ecde61c852a62405b853b667498b07da6ff05c29fe8c79096b"}, + {file = "web3-6.15.1.tar.gz", hash = "sha256:f9e7eefc1b3c3d194868a4ef9583b625c18ea3f31a48ebe143183db74898f381"}, ] [package.dependencies] @@ -1886,9 +1884,9 @@ eth-account = ">=0.8.0" eth-hash = {version = ">=0.5.1", extras = ["pycryptodome"]} eth-typing = ">=3.0.0" eth-utils = ">=2.1.0" -hexbytes = ">=0.1.0" +hexbytes = ">=0.1.0,<0.4.0" jsonschema = ">=4.0.0" -lru-dict = ">=1.1.6" +lru-dict = ">=1.1.6,<1.3.0" protobuf = ">=4.21.6" pyunormalize = ">=15.0.0" pywin32 = {version = ">=223", markers = "platform_system == \"Windows\""} @@ -1897,11 +1895,11 @@ typing-extensions = ">=4.0.1" websockets = ">=10.0.0" [package.extras] -dev = ["black (>=22.1.0)", "build (>=0.9.0)", "bumpversion", "eth-tester[py-evm] (==v0.9.1-b.1)", "flake8 (==3.8.3)", "flaky (>=3.7.0)", "hypothesis (>=3.31.2)", "importlib-metadata (<5.0)", "ipfshttpclient (==0.8.0a2)", "isort (>=5.11.0)", "mypy (>=1.0.0)", "py-geth (>=3.11.0)", "pytest (>=7.0.0)", "pytest-asyncio (>=0.18.1)", "pytest-mock (>=1.10)", "pytest-watch (>=4.2)", "pytest-xdist (>=1.29)", "setuptools (>=38.6.0)", "sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)", "tox (>=3.18.0)", "tqdm (>4.32)", "twine (>=1.13)", "types-protobuf (==3.19.13)", "types-requests (>=2.26.1)", "types-setuptools (>=57.4.4)", "when-changed (>=0.3.0)"] +dev = ["black (>=22.1.0)", "build (>=0.9.0)", "bumpversion", "eth-tester[py-evm] (==v0.9.1-b.2)", "flake8 (==3.8.3)", "flaky (>=3.7.0)", "hypothesis (>=3.31.2)", "importlib-metadata (<5.0)", "ipfshttpclient (==0.8.0a2)", "isort (>=5.11.0)", "mypy (==1.4.1)", "py-geth (>=3.14.0)", "pytest (>=7.0.0)", "pytest-asyncio (>=0.18.1,<0.23)", "pytest-mock (>=1.10)", "pytest-watch (>=4.2)", "pytest-xdist (>=1.29)", "setuptools (>=38.6.0)", "sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)", "tox (>=3.18.0)", "tqdm (>4.32)", "twine (>=1.13)", "types-protobuf (==3.19.13)", "types-requests (>=2.26.1)", "types-setuptools (>=57.4.4)", "when-changed (>=0.3.0)"] docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.0.0)", "towncrier (>=21,<22)"] ipfs = ["ipfshttpclient (==0.8.0a2)"] -linter = ["black (>=22.1.0)", "flake8 (==3.8.3)", "isort (>=5.11.0)", "mypy (>=1.0.0)", "types-protobuf (==3.19.13)", "types-requests (>=2.26.1)", "types-setuptools (>=57.4.4)"] -tester = ["eth-tester[py-evm] (==v0.9.1-b.1)", "py-geth (>=3.11.0)"] +linter = ["black (>=22.1.0)", "flake8 (==3.8.3)", "isort (>=5.11.0)", "mypy (==1.4.1)", "types-protobuf (==3.19.13)", "types-requests (>=2.26.1)", "types-setuptools (>=57.4.4)"] +tester = ["eth-tester[py-evm] (==v0.9.1-b.2)", "py-geth (>=3.14.0)"] [[package]] name = "websockets" @@ -2072,4 +2070,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "47c25223f95066f5b311d8ee07c1b6385580aea1beba0e217339a4e9e2b8e046" +content-hash = "e69cc38402d3dc869bdca234d2b905022fbf152f641717910b78d809e89bde98" diff --git a/pyproject.toml b/pyproject.toml index a0fcd9f..6281cdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dkg" -version = "0.1.0-beta.5" +version = "0.1.0-beta.6" description = "Python library for interacting with the OriginTrail Decentralized Knowledge Graph" authors = ["Uladzislau Hubar "] license = "Apache-2.0" @@ -8,13 +8,13 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.10" -pyyaml = "^6.0" -web3 = "^6.0.0" +pyyaml = "^6.0.1" +web3 = "^6.15.1" pandas = "^1.5.3" -eth-account = "^0.8.0" +eth-account = "^0.11.0" rdflib = "^6.3.2" hexbytes = "^0.3.0" -eth-abi = "^4.0.0" +eth-abi = "^5.0.1" ot-pyld = "^2.1.1"