tusdt-cli 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/PKG-INFO +1 -1
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/pyproject.toml +1 -1
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/__init__.py +1 -1
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/client.py +13 -6
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/.gitignore +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/LICENSE +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/README.md +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/requirements.txt +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/abi/tusdt_auction.json +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/abi/tusdt_erc20.json +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/abi/tusdt_governance.json +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/abi/tusdt_oracle.json +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/abi/tusdt_treasury.json +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/abi/tusdt_vault.json +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/cli.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/commands/__init__.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/commands/auction.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/commands/governance.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/commands/oracle.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/commands/token.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/commands/treasury.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/commands/vault.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/config.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/utils.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/src/tusdt_cli/wallet.py +0 -0
- {tusdt_cli-0.2.2 → tusdt_cli-0.2.3}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tusdt-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: CLI for interacting with the TUSDT ink! smart contract system on subtensor(bittensor)
|
|
5
5
|
Project-URL: Homepage, https://github.com/tensorusd/tusdt-cli
|
|
6
6
|
Project-URL: Repository, https://github.com/tensorusd/tusdt-cli
|
|
@@ -9,9 +9,8 @@ from typing import Any
|
|
|
9
9
|
|
|
10
10
|
from substrateinterface import Keypair, SubstrateInterface
|
|
11
11
|
from substrateinterface.contracts import ContractInstance, ContractMetadata
|
|
12
|
-
from substrateinterface.exceptions import ContractReadFailedException
|
|
13
|
-
|
|
14
12
|
from substrateinterface.contracts import ContractMetadata as _ContractMetadata
|
|
13
|
+
from substrateinterface.exceptions import ContractReadFailedException
|
|
15
14
|
|
|
16
15
|
from tusdt_cli.utils import (
|
|
17
16
|
ContractError,
|
|
@@ -21,6 +20,7 @@ from tusdt_cli.utils import (
|
|
|
21
20
|
unwrap_result,
|
|
22
21
|
)
|
|
23
22
|
|
|
23
|
+
|
|
24
24
|
# ---------------------------------------------------------------------------
|
|
25
25
|
# Patch: fix substrate-interface 1.8.1 V5 metadata loading bug
|
|
26
26
|
#
|
|
@@ -55,10 +55,14 @@ def _fixed_convert(self: _ContractMetadata) -> None:
|
|
|
55
55
|
|
|
56
56
|
# V1 -> V2: name -> label
|
|
57
57
|
if self.metadata_version <= 1:
|
|
58
|
+
|
|
58
59
|
def _replace_name(obj: dict) -> dict:
|
|
59
60
|
if "name" in obj:
|
|
60
|
-
obj["label"] =
|
|
61
|
+
obj["label"] = (
|
|
62
|
+
"::".join(obj.pop("name")) if isinstance(obj["name"], list) else obj.pop("name")
|
|
63
|
+
)
|
|
61
64
|
return obj
|
|
65
|
+
|
|
62
66
|
for section in ("constructors", "events", "messages"):
|
|
63
67
|
for idx, c in enumerate(self.metadata_dict["spec"][section]):
|
|
64
68
|
self.metadata_dict["spec"][section][idx]["args"] = [_replace_name(a) for a in c["args"]]
|
|
@@ -66,18 +70,20 @@ def _fixed_convert(self: _ContractMetadata) -> None:
|
|
|
66
70
|
|
|
67
71
|
# V2 -> V3: default payable=True for constructors
|
|
68
72
|
if self.metadata_version <= 2:
|
|
69
|
-
for
|
|
73
|
+
for _idx, c in enumerate(self.metadata_dict["spec"]["constructors"]):
|
|
70
74
|
c["payable"] = True
|
|
71
75
|
|
|
72
76
|
# V4 -> V5: add module_path and signature_topic to events
|
|
73
77
|
if self.metadata_version <= 4:
|
|
74
|
-
for
|
|
78
|
+
for _idx, event in enumerate(self.metadata_dict["spec"]["events"]):
|
|
75
79
|
event["module_path"] = event.get("module_path", "")
|
|
76
80
|
event["signature_topic"] = event.get("signature_topic", "")
|
|
77
81
|
|
|
78
82
|
# Set type offset and prefix
|
|
79
83
|
self._ContractMetadata__type_offset = 0
|
|
80
|
-
if "V0" in self.metadata_dict and tuple(
|
|
84
|
+
if "V0" in self.metadata_dict and tuple(
|
|
85
|
+
int(x) for x in self.metadata_dict["metadataVersion"].split(".")
|
|
86
|
+
) < (0, 7, 0):
|
|
81
87
|
self._ContractMetadata__type_offset = 1
|
|
82
88
|
|
|
83
89
|
self.type_string_prefix = f"ink::{self.metadata_dict['source']['hash']}"
|
|
@@ -97,6 +103,7 @@ def _fixed_convert(self: _ContractMetadata) -> None:
|
|
|
97
103
|
raw_types = raw_types.value_object
|
|
98
104
|
self.substrate.runtime_config.update_from_scale_info_types(raw_types, prefix=self.type_string_prefix)
|
|
99
105
|
|
|
106
|
+
|
|
100
107
|
_ContractMetadata._ContractMetadata__convert_to_latest_metadata = _fixed_convert
|
|
101
108
|
|
|
102
109
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|