pactus-jsonrpc 1.7.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Pactus blockchain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.4
2
+ Name: pactus-jsonrpc
3
+ Version: 1.7.0
4
+ Summary: Python client for interacting with the Pactus blockchain via JSON-RPC
5
+ Home-page: https://github.com/pactus-project/pactus
6
+ Author: Pactus Development Team
7
+ Author-email: info@pactus.org
8
+ License: MIT
9
+ Keywords: pactus,blockchain,json-rpc
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Build Tools
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.6
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: jsonrpc2-pyclient>=5.2.0
18
+ Requires-Dist: py-undefined>=0.1.5
19
+ Requires-Dist: pydantic>=2.5.3
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: license
28
+ Dynamic: license-file
29
+ Dynamic: requires-dist
30
+ Dynamic: requires-python
31
+ Dynamic: summary
32
+
33
+ [![codecov](https://codecov.io/gh/pactus-project/pactus/branch/main/graph/badge.svg?token=8N6N60D5UI)](https://codecov.io/gh/pactus-project/pactus)
34
+ [![Go Report Card](https://goreportcard.com/badge/github.com/pactus-project/pactus)](https://goreportcard.com/report/github.com/pactus-project/pactus)
35
+ [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/zPqWqV85ch)
36
+
37
+ ------
38
+
39
+ # Pactus Blockchain
40
+
41
+ A full-node implementation of the Pactus blockchain in Go.
42
+
43
+ ## Install
44
+
45
+ Please check the [install](./docs/install.md) document to build and run the Pactus blockchain.
46
+
47
+ ## Contribution
48
+
49
+ Contributions to the Pactus blockchain are appreciated.
50
+ Please read the [CONTRIBUTING](./CONTRIBUTING.md) guidelines before submitting a pull request or opening an issue.
51
+
52
+ ## License
53
+
54
+ The Pactus blockchain is under MIT [license](./LICENSE).
55
+
@@ -0,0 +1,23 @@
1
+ [![codecov](https://codecov.io/gh/pactus-project/pactus/branch/main/graph/badge.svg?token=8N6N60D5UI)](https://codecov.io/gh/pactus-project/pactus)
2
+ [![Go Report Card](https://goreportcard.com/badge/github.com/pactus-project/pactus)](https://goreportcard.com/report/github.com/pactus-project/pactus)
3
+ [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/zPqWqV85ch)
4
+
5
+ ------
6
+
7
+ # Pactus Blockchain
8
+
9
+ A full-node implementation of the Pactus blockchain in Go.
10
+
11
+ ## Install
12
+
13
+ Please check the [install](./docs/install.md) document to build and run the Pactus blockchain.
14
+
15
+ ## Contribution
16
+
17
+ Contributions to the Pactus blockchain are appreciated.
18
+ Please read the [CONTRIBUTING](./CONTRIBUTING.md) guidelines before submitting a pull request or opening an issue.
19
+
20
+ ## License
21
+
22
+ The Pactus blockchain is under MIT [license](./LICENSE).
23
+
File without changes
@@ -0,0 +1,262 @@
1
+ """Python client template."""
2
+
3
+ import datetime
4
+ from typing import Any, Literal, Union
5
+ from uuid import UUID
6
+
7
+ from jsonrpc2pyclient.decorator import Transportable, rpc_class_method
8
+ from jsonrpc2pyclient.httpclient import AsyncRPCHTTPClient
9
+ from jsonrpc2pyclient.rpcclient import AsyncRPCClient, RPCClient
10
+ from py_undefined import Undefined
11
+ from pydantic import UUID1, UUID3, UUID4, UUID5
12
+
13
+
14
+ ClientType = Union[AsyncRPCClient, RPCClient]
15
+ CLIENT_URL = "example.com"
16
+
17
+
18
+ class PactusOpenRPCClient(Transportable):
19
+ def __init__(
20
+ self, headers: dict[str, Any], client_url: str = CLIENT_URL, **kwargs: Any
21
+ ) -> None:
22
+ transport = AsyncRPCHTTPClient(client_url, headers, **kwargs)
23
+ self.pactus = PactusOpenRPCClient._PactusClient(transport)
24
+ super().__init__(transport)
25
+
26
+ class _PactusClient(Transportable):
27
+ def __init__(self, transport: ClientType) -> None:
28
+ self.transaction = PactusOpenRPCClient._PactusClient._TransactionClient(
29
+ transport
30
+ )
31
+ self.blockchain = PactusOpenRPCClient._PactusClient._BlockchainClient(
32
+ transport
33
+ )
34
+ self.network = PactusOpenRPCClient._PactusClient._NetworkClient(transport)
35
+ self.utils = PactusOpenRPCClient._PactusClient._UtilsClient(transport)
36
+ self.wallet = PactusOpenRPCClient._PactusClient._WalletClient(transport)
37
+ super().__init__(transport)
38
+
39
+ class _TransactionClient(Transportable):
40
+ @rpc_class_method(method_name="pactus.transaction.get_transaction")
41
+ async def get_transaction(
42
+ self, id: str = Undefined, verbosity: int = Undefined
43
+ ) -> dict[str, Any]: ...
44
+ @rpc_class_method(method_name="pactus.transaction.calculate_fee")
45
+ async def calculate_fee(
46
+ self,
47
+ amount: int = Undefined,
48
+ payload_type: int = Undefined,
49
+ fixed_amount: bool = Undefined,
50
+ ) -> dict[str, Any]: ...
51
+ @rpc_class_method(method_name="pactus.transaction.broadcast_transaction")
52
+ async def broadcast_transaction(
53
+ self, signed_raw_transaction: str = Undefined
54
+ ) -> dict[str, Any]: ...
55
+ @rpc_class_method(
56
+ method_name="pactus.transaction.get_raw_transfer_transaction"
57
+ )
58
+ async def get_raw_transfer_transaction(
59
+ self,
60
+ lock_time: int = Undefined,
61
+ sender: str = Undefined,
62
+ receiver: str = Undefined,
63
+ amount: int = Undefined,
64
+ fee: int = Undefined,
65
+ memo: str = Undefined,
66
+ ) -> dict[str, Any]: ...
67
+ @rpc_class_method(method_name="pactus.transaction.get_raw_bond_transaction")
68
+ async def get_raw_bond_transaction(
69
+ self,
70
+ lock_time: int = Undefined,
71
+ sender: str = Undefined,
72
+ receiver: str = Undefined,
73
+ stake: int = Undefined,
74
+ public_key: str = Undefined,
75
+ fee: int = Undefined,
76
+ memo: str = Undefined,
77
+ ) -> dict[str, Any]: ...
78
+ @rpc_class_method(
79
+ method_name="pactus.transaction.get_raw_unbond_transaction"
80
+ )
81
+ async def get_raw_unbond_transaction(
82
+ self,
83
+ lock_time: int = Undefined,
84
+ validator_address: str = Undefined,
85
+ memo: str = Undefined,
86
+ ) -> dict[str, Any]: ...
87
+ @rpc_class_method(
88
+ method_name="pactus.transaction.get_raw_withdraw_transaction"
89
+ )
90
+ async def get_raw_withdraw_transaction(
91
+ self,
92
+ lock_time: int = Undefined,
93
+ validator_address: str = Undefined,
94
+ account_address: str = Undefined,
95
+ amount: int = Undefined,
96
+ fee: int = Undefined,
97
+ memo: str = Undefined,
98
+ ) -> dict[str, Any]: ...
99
+ @rpc_class_method(
100
+ method_name="pactus.transaction.get_raw_batch_transfer_transaction"
101
+ )
102
+ async def get_raw_batch_transfer_transaction(
103
+ self,
104
+ lock_time: int = Undefined,
105
+ sender: str = Undefined,
106
+ recipients: list[dict[str, Any]] = Undefined,
107
+ fee: int = Undefined,
108
+ memo: str = Undefined,
109
+ ) -> dict[str, Any]: ...
110
+ @rpc_class_method(method_name="pactus.transaction.decode_raw_transaction")
111
+ async def decode_raw_transaction(
112
+ self, raw_transaction: str = Undefined
113
+ ) -> dict[str, Any]: ...
114
+
115
+ class _BlockchainClient(Transportable):
116
+ @rpc_class_method(method_name="pactus.blockchain.get_block")
117
+ async def get_block(
118
+ self, height: int = Undefined, verbosity: int = Undefined
119
+ ) -> dict[str, Any]: ...
120
+ @rpc_class_method(method_name="pactus.blockchain.get_block_hash")
121
+ async def get_block_hash(
122
+ self, height: int = Undefined
123
+ ) -> dict[str, Any]: ...
124
+ @rpc_class_method(method_name="pactus.blockchain.get_block_height")
125
+ async def get_block_height(
126
+ self, hash: str = Undefined
127
+ ) -> dict[str, Any]: ...
128
+ @rpc_class_method(method_name="pactus.blockchain.get_blockchain_info")
129
+ async def get_blockchain_info(self) -> dict[str, Any]: ...
130
+ @rpc_class_method(method_name="pactus.blockchain.get_consensus_info")
131
+ async def get_consensus_info(self) -> dict[str, Any]: ...
132
+ @rpc_class_method(method_name="pactus.blockchain.get_account")
133
+ async def get_account(self, address: str = Undefined) -> dict[str, Any]: ...
134
+ @rpc_class_method(method_name="pactus.blockchain.get_validator")
135
+ async def get_validator(
136
+ self, address: str = Undefined
137
+ ) -> dict[str, Any]: ...
138
+ @rpc_class_method(method_name="pactus.blockchain.get_validator_by_number")
139
+ async def get_validator_by_number(
140
+ self, number: int = Undefined
141
+ ) -> dict[str, Any]: ...
142
+ @rpc_class_method(method_name="pactus.blockchain.get_validator_addresses")
143
+ async def get_validator_addresses(self) -> dict[str, Any]: ...
144
+ @rpc_class_method(method_name="pactus.blockchain.get_public_key")
145
+ async def get_public_key(
146
+ self, address: str = Undefined
147
+ ) -> dict[str, Any]: ...
148
+ @rpc_class_method(method_name="pactus.blockchain.get_tx_pool_content")
149
+ async def get_tx_pool_content(
150
+ self, payload_type: int = Undefined
151
+ ) -> dict[str, Any]: ...
152
+
153
+ class _NetworkClient(Transportable):
154
+ @rpc_class_method(method_name="pactus.network.get_network_info")
155
+ async def get_network_info(
156
+ self, only_connected: bool = Undefined
157
+ ) -> dict[str, Any]: ...
158
+ @rpc_class_method(method_name="pactus.network.get_node_info")
159
+ async def get_node_info(self) -> dict[str, Any]: ...
160
+
161
+ class _UtilsClient(Transportable):
162
+ @rpc_class_method(method_name="pactus.utils.sign_message_with_private_key")
163
+ async def sign_message_with_private_key(
164
+ self, private_key: str = Undefined, message: str = Undefined
165
+ ) -> dict[str, Any]: ...
166
+ @rpc_class_method(method_name="pactus.utils.verify_message")
167
+ async def verify_message(
168
+ self,
169
+ message: str = Undefined,
170
+ signature: str = Undefined,
171
+ public_key: str = Undefined,
172
+ ) -> dict[str, Any]: ...
173
+ @rpc_class_method(method_name="pactus.utils.public_key_aggregation")
174
+ async def public_key_aggregation(
175
+ self, public_keys: list[str] = Undefined
176
+ ) -> dict[str, Any]: ...
177
+ @rpc_class_method(method_name="pactus.utils.signature_aggregation")
178
+ async def signature_aggregation(
179
+ self, signatures: list[str] = Undefined
180
+ ) -> dict[str, Any]: ...
181
+
182
+ class _WalletClient(Transportable):
183
+ @rpc_class_method(method_name="pactus.wallet.create_wallet")
184
+ async def create_wallet(
185
+ self, wallet_name: str = Undefined, password: str = Undefined
186
+ ) -> dict[str, Any]: ...
187
+ @rpc_class_method(method_name="pactus.wallet.restore_wallet")
188
+ async def restore_wallet(
189
+ self,
190
+ wallet_name: str = Undefined,
191
+ mnemonic: str = Undefined,
192
+ password: str = Undefined,
193
+ ) -> dict[str, Any]: ...
194
+ @rpc_class_method(method_name="pactus.wallet.load_wallet")
195
+ async def load_wallet(
196
+ self, wallet_name: str = Undefined
197
+ ) -> dict[str, Any]: ...
198
+ @rpc_class_method(method_name="pactus.wallet.unload_wallet")
199
+ async def unload_wallet(
200
+ self, wallet_name: str = Undefined
201
+ ) -> dict[str, Any]: ...
202
+ @rpc_class_method(method_name="pactus.wallet.get_total_balance")
203
+ async def get_total_balance(
204
+ self, wallet_name: str = Undefined
205
+ ) -> dict[str, Any]: ...
206
+ @rpc_class_method(method_name="pactus.wallet.sign_raw_transaction")
207
+ async def sign_raw_transaction(
208
+ self,
209
+ wallet_name: str = Undefined,
210
+ raw_transaction: str = Undefined,
211
+ password: str = Undefined,
212
+ ) -> dict[str, Any]: ...
213
+ @rpc_class_method(method_name="pactus.wallet.get_validator_address")
214
+ async def get_validator_address(
215
+ self, public_key: str = Undefined
216
+ ) -> dict[str, Any]: ...
217
+ @rpc_class_method(method_name="pactus.wallet.get_new_address")
218
+ async def get_new_address(
219
+ self,
220
+ wallet_name: str = Undefined,
221
+ address_type: int = Undefined,
222
+ label: str = Undefined,
223
+ password: str = Undefined,
224
+ ) -> dict[str, Any]: ...
225
+ @rpc_class_method(method_name="pactus.wallet.get_address_history")
226
+ async def get_address_history(
227
+ self, wallet_name: str = Undefined, address: str = Undefined
228
+ ) -> dict[str, Any]: ...
229
+ @rpc_class_method(method_name="pactus.wallet.sign_message")
230
+ async def sign_message(
231
+ self,
232
+ wallet_name: str = Undefined,
233
+ password: str = Undefined,
234
+ address: str = Undefined,
235
+ message: str = Undefined,
236
+ ) -> dict[str, Any]: ...
237
+ @rpc_class_method(method_name="pactus.wallet.get_total_stake")
238
+ async def get_total_stake(
239
+ self, wallet_name: str = Undefined
240
+ ) -> dict[str, Any]: ...
241
+ @rpc_class_method(method_name="pactus.wallet.get_address_info")
242
+ async def get_address_info(
243
+ self, wallet_name: str = Undefined, address: str = Undefined
244
+ ) -> dict[str, Any]: ...
245
+ @rpc_class_method(method_name="pactus.wallet.set_address_label")
246
+ async def set_address_label(
247
+ self,
248
+ wallet_name: str = Undefined,
249
+ password: str = Undefined,
250
+ address: str = Undefined,
251
+ label: str = Undefined,
252
+ ) -> dict[str, Any]: ...
253
+ @rpc_class_method(method_name="pactus.wallet.list_wallet")
254
+ async def list_wallet(self) -> dict[str, Any]: ...
255
+ @rpc_class_method(method_name="pactus.wallet.get_wallet_info")
256
+ async def get_wallet_info(
257
+ self, wallet_name: str = Undefined
258
+ ) -> dict[str, Any]: ...
259
+ @rpc_class_method(method_name="pactus.wallet.list_address")
260
+ async def list_address(
261
+ self, wallet_name: str = Undefined
262
+ ) -> dict[str, Any]: ...
@@ -0,0 +1,8 @@
1
+ from __future__ import annotations
2
+
3
+ from uuid import UUID
4
+ import datetime
5
+ from enum import Enum
6
+ from typing import Any, Literal
7
+
8
+ from pydantic import BaseModel, UUID1, UUID3, UUID4, UUID5
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.4
2
+ Name: pactus-jsonrpc
3
+ Version: 1.7.0
4
+ Summary: Python client for interacting with the Pactus blockchain via JSON-RPC
5
+ Home-page: https://github.com/pactus-project/pactus
6
+ Author: Pactus Development Team
7
+ Author-email: info@pactus.org
8
+ License: MIT
9
+ Keywords: pactus,blockchain,json-rpc
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Topic :: Software Development :: Build Tools
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.6
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: jsonrpc2-pyclient>=5.2.0
18
+ Requires-Dist: py-undefined>=0.1.5
19
+ Requires-Dist: pydantic>=2.5.3
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: description-content-type
25
+ Dynamic: home-page
26
+ Dynamic: keywords
27
+ Dynamic: license
28
+ Dynamic: license-file
29
+ Dynamic: requires-dist
30
+ Dynamic: requires-python
31
+ Dynamic: summary
32
+
33
+ [![codecov](https://codecov.io/gh/pactus-project/pactus/branch/main/graph/badge.svg?token=8N6N60D5UI)](https://codecov.io/gh/pactus-project/pactus)
34
+ [![Go Report Card](https://goreportcard.com/badge/github.com/pactus-project/pactus)](https://goreportcard.com/report/github.com/pactus-project/pactus)
35
+ [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/zPqWqV85ch)
36
+
37
+ ------
38
+
39
+ # Pactus Blockchain
40
+
41
+ A full-node implementation of the Pactus blockchain in Go.
42
+
43
+ ## Install
44
+
45
+ Please check the [install](./docs/install.md) document to build and run the Pactus blockchain.
46
+
47
+ ## Contribution
48
+
49
+ Contributions to the Pactus blockchain are appreciated.
50
+ Please read the [CONTRIBUTING](./CONTRIBUTING.md) guidelines before submitting a pull request or opening an issue.
51
+
52
+ ## License
53
+
54
+ The Pactus blockchain is under MIT [license](./LICENSE).
55
+
@@ -0,0 +1,12 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ pactus_jsonrpc/__init__.py
6
+ pactus_jsonrpc/client.py
7
+ pactus_jsonrpc/models.py
8
+ pactus_jsonrpc.egg-info/PKG-INFO
9
+ pactus_jsonrpc.egg-info/SOURCES.txt
10
+ pactus_jsonrpc.egg-info/dependency_links.txt
11
+ pactus_jsonrpc.egg-info/requires.txt
12
+ pactus_jsonrpc.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ jsonrpc2-pyclient>=5.2.0
2
+ py-undefined>=0.1.5
3
+ pydantic>=2.5.3
@@ -0,0 +1 @@
1
+ pactus_jsonrpc
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools >= 42.0.0"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,29 @@
1
+ from pathlib import Path
2
+
3
+ from setuptools import find_packages, setup
4
+
5
+ setup(
6
+ name="pactus-jsonrpc",
7
+ version="1.7.0",
8
+ author="Pactus Development Team",
9
+ author_email="info@pactus.org",
10
+ description="Python client for interacting with the Pactus blockchain via JSON-RPC",
11
+ long_description=Path("README.md").read_text(encoding="utf-8"),
12
+ long_description_content_type="text/markdown",
13
+ url="https://github.com/pactus-project/pactus",
14
+ packages=find_packages(),
15
+ license="MIT",
16
+ install_requires=[
17
+ "jsonrpc2-pyclient>=5.2.0",
18
+ "py-undefined>=0.1.5",
19
+ "pydantic>=2.5.3"
20
+ ],
21
+ keywords=["pactus", "blockchain", "json-rpc"],
22
+ classifiers=[
23
+ "Development Status :: 5 - Production/Stable",
24
+ "Intended Audience :: Developers",
25
+ "Topic :: Software Development :: Build Tools",
26
+ "Operating System :: OS Independent",
27
+ ],
28
+ python_requires=">=3.6",
29
+ )