qorechain-rdk 0.3.1__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.
- qorechain_rdk-0.3.1/PKG-INFO +75 -0
- qorechain_rdk-0.3.1/README.md +47 -0
- qorechain_rdk-0.3.1/pyproject.toml +49 -0
- qorechain_rdk-0.3.1/setup.cfg +4 -0
- qorechain_rdk-0.3.1/src/qorechain_rdk.egg-info/PKG-INFO +75 -0
- qorechain_rdk-0.3.1/src/qorechain_rdk.egg-info/SOURCES.txt +62 -0
- qorechain_rdk-0.3.1/src/qorechain_rdk.egg-info/dependency_links.txt +1 -0
- qorechain_rdk-0.3.1/src/qorechain_rdk.egg-info/requires.txt +8 -0
- qorechain_rdk-0.3.1/src/qorechain_rdk.egg-info/top_level.txt +1 -0
- qorechain_rdk-0.3.1/src/qorrdk/__init__.py +372 -0
- qorechain_rdk-0.3.1/src/qorrdk/accounts/__init__.py +28 -0
- qorechain_rdk-0.3.1/src/qorrdk/accounts/wallet.py +213 -0
- qorechain_rdk-0.3.1/src/qorrdk/bridge/__init__.py +27 -0
- qorechain_rdk-0.3.1/src/qorrdk/bridge/merkle.py +141 -0
- qorechain_rdk-0.3.1/src/qorrdk/bridge/withdrawal.py +71 -0
- qorechain_rdk-0.3.1/src/qorrdk/client/__init__.py +32 -0
- qorechain_rdk-0.3.1/src/qorrdk/client/http.py +90 -0
- qorechain_rdk-0.3.1/src/qorrdk/client/jsonrpc.py +68 -0
- qorechain_rdk-0.3.1/src/qorrdk/client/rdk_client.py +75 -0
- qorechain_rdk-0.3.1/src/qorrdk/client/rest.py +114 -0
- qorechain_rdk-0.3.1/src/qorrdk/client/views.py +142 -0
- qorechain_rdk-0.3.1/src/qorrdk/config/__init__.py +45 -0
- qorechain_rdk-0.3.1/src/qorrdk/config/builder.py +101 -0
- qorechain_rdk-0.3.1/src/qorrdk/config/errors.py +16 -0
- qorechain_rdk-0.3.1/src/qorrdk/config/matrix.py +46 -0
- qorechain_rdk-0.3.1/src/qorrdk/config/networks.py +74 -0
- qorechain_rdk-0.3.1/src/qorrdk/config/types.py +113 -0
- qorechain_rdk-0.3.1/src/qorrdk/config/validate.py +151 -0
- qorechain_rdk-0.3.1/src/qorrdk/constants.py +68 -0
- qorechain_rdk-0.3.1/src/qorrdk/da/__init__.py +73 -0
- qorechain_rdk-0.3.1/src/qorrdk/enums.py +126 -0
- qorechain_rdk-0.3.1/src/qorrdk/events/__init__.py +19 -0
- qorechain_rdk-0.3.1/src/qorrdk/events/decode.py +80 -0
- qorechain_rdk-0.3.1/src/qorrdk/faucet/__init__.py +52 -0
- qorechain_rdk-0.3.1/src/qorrdk/health/__init__.py +78 -0
- qorechain_rdk-0.3.1/src/qorrdk/lifecycle/__init__.py +23 -0
- qorechain_rdk-0.3.1/src/qorrdk/lifecycle/state_machine.py +80 -0
- qorechain_rdk-0.3.1/src/qorrdk/manifest/__init__.py +199 -0
- qorechain_rdk-0.3.1/src/qorrdk/monitor/__init__.py +92 -0
- qorechain_rdk-0.3.1/src/qorrdk/preflight/__init__.py +154 -0
- qorechain_rdk-0.3.1/src/qorrdk/presets.py +126 -0
- qorechain_rdk-0.3.1/src/qorrdk/profiles.py +64 -0
- qorechain_rdk-0.3.1/src/qorrdk/py.typed +0 -0
- qorechain_rdk-0.3.1/src/qorrdk/tx/__init__.py +51 -0
- qorechain_rdk-0.3.1/src/qorrdk/tx/client.py +419 -0
- qorechain_rdk-0.3.1/src/qorrdk/tx/codecs.py +233 -0
- qorechain_rdk-0.3.1/src/qorrdk/tx/messages.py +199 -0
- qorechain_rdk-0.3.1/src/qorrdk/tx/mock.py +78 -0
- qorechain_rdk-0.3.1/src/qorrdk/utils/__init__.py +22 -0
- qorechain_rdk-0.3.1/src/qorrdk/utils/bech32.py +40 -0
- qorechain_rdk-0.3.1/src/qorrdk/utils/bytes.py +31 -0
- qorechain_rdk-0.3.1/src/qorrdk/utils/denom.py +67 -0
- qorechain_rdk-0.3.1/src/qorrdk/utils/economics.py +80 -0
- qorechain_rdk-0.3.1/tests/test_accounts.py +66 -0
- qorechain_rdk-0.3.1/tests/test_bridge.py +48 -0
- qorechain_rdk-0.3.1/tests/test_client.py +222 -0
- qorechain_rdk-0.3.1/tests/test_config.py +121 -0
- qorechain_rdk-0.3.1/tests/test_manifest.py +64 -0
- qorechain_rdk-0.3.1/tests/test_misc.py +197 -0
- qorechain_rdk-0.3.1/tests/test_monitor.py +131 -0
- qorechain_rdk-0.3.1/tests/test_presets.py +55 -0
- qorechain_rdk-0.3.1/tests/test_tx.py +159 -0
- qorechain_rdk-0.3.1/tests/test_tx_mock.py +75 -0
- qorechain_rdk-0.3.1/tests/test_utils.py +72 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qorechain-rdk
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: Python Rollup Development Kit for the QoreChain network.
|
|
5
|
+
Author: QoreChain
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/qorechain/qorechain-rdk
|
|
8
|
+
Project-URL: Repository, https://github.com/qorechain/qorechain-rdk
|
|
9
|
+
Keywords: qorechain,rollup,rdk,blockchain
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: cosmpy>=0.9
|
|
22
|
+
Requires-Dist: requests>=2.28
|
|
23
|
+
Requires-Dist: bech32>=1.2
|
|
24
|
+
Requires-Dist: mnemonic>=0.20
|
|
25
|
+
Requires-Dist: ecdsa>=0.18
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
28
|
+
|
|
29
|
+
# qorechain-rdk (Python)
|
|
30
|
+
|
|
31
|
+
Python Rollup Development Kit for the QoreChain network.
|
|
32
|
+
|
|
33
|
+
**Status: Available.** This package mirrors the TypeScript RDK
|
|
34
|
+
(`@qorechain/rdk`) with idiomatic, type-hinted, snake_case Python — typed rollup
|
|
35
|
+
configuration with the compatibility matrix enforced, preset profiles, the
|
|
36
|
+
rollup and settlement-batch lifecycles, native data availability, transaction
|
|
37
|
+
signing and broadcast, and the read clients.
|
|
38
|
+
|
|
39
|
+
Surface (mirrors the TypeScript RDK modules):
|
|
40
|
+
|
|
41
|
+
- Typed rollup configuration and builder, with the settlement / sequencer /
|
|
42
|
+
proof / DA / gas / VM compatibility matrix validated client-side.
|
|
43
|
+
- The five preset profiles: `defi`, `gaming`, `nft`, `enterprise`, `custom`.
|
|
44
|
+
- Exact denom conversion and creation-cost economics (integer math, no float).
|
|
45
|
+
- Binary-Merkle withdrawal-proof assembly for the bridge.
|
|
46
|
+
- Portable rollup manifests (save / share / reload).
|
|
47
|
+
- Account derivation from a BIP-39 mnemonic (BIP-44 `m/44'/118'/0'/0/0`,
|
|
48
|
+
secp256k1, bech32 `qor`) and a SIGN_MODE_DIRECT signer.
|
|
49
|
+
- Hand-encoded protobuf codecs for the eight `rdk` messages, a full transaction
|
|
50
|
+
builder, and broadcast via the REST `/cosmos/tx/v1beta1/txs` endpoint.
|
|
51
|
+
- Read clients: REST (LCD), the `qor_` JSON-RPC namespace, typed views, and the
|
|
52
|
+
`RdkClient` facade — plus preflight ("doctor"), rollup health, event decoding,
|
|
53
|
+
and a faucet helper. Live broadcast requires a reachable node endpoint; the
|
|
54
|
+
HTTP transport is injectable for testing.
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
pip install qorechain-rdk
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> Install as `qorechain-rdk`; import as `qorrdk`.
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from qorrdk import presets, create_rdk_client, signer_from_env
|
|
64
|
+
|
|
65
|
+
# Build and validate a rollup configuration.
|
|
66
|
+
config = presets.defi("my-rollup").set(stake_amount_uqor="10000000000").build()
|
|
67
|
+
|
|
68
|
+
# Connect, sign, and broadcast (needs a reachable node endpoint).
|
|
69
|
+
client = create_rdk_client(network="testnet")
|
|
70
|
+
signer = signer_from_env() # QORE_OPERATOR_PRIVATE_KEY_HEX or QORE_MNEMONIC
|
|
71
|
+
if signer is not None:
|
|
72
|
+
tx = client.connect_tx(signer)
|
|
73
|
+
tx.create_rollup(rollup_id="my-rollup", profile="defi", vm_type="evm",
|
|
74
|
+
stake_amount="10000000000")
|
|
75
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# qorechain-rdk (Python)
|
|
2
|
+
|
|
3
|
+
Python Rollup Development Kit for the QoreChain network.
|
|
4
|
+
|
|
5
|
+
**Status: Available.** This package mirrors the TypeScript RDK
|
|
6
|
+
(`@qorechain/rdk`) with idiomatic, type-hinted, snake_case Python — typed rollup
|
|
7
|
+
configuration with the compatibility matrix enforced, preset profiles, the
|
|
8
|
+
rollup and settlement-batch lifecycles, native data availability, transaction
|
|
9
|
+
signing and broadcast, and the read clients.
|
|
10
|
+
|
|
11
|
+
Surface (mirrors the TypeScript RDK modules):
|
|
12
|
+
|
|
13
|
+
- Typed rollup configuration and builder, with the settlement / sequencer /
|
|
14
|
+
proof / DA / gas / VM compatibility matrix validated client-side.
|
|
15
|
+
- The five preset profiles: `defi`, `gaming`, `nft`, `enterprise`, `custom`.
|
|
16
|
+
- Exact denom conversion and creation-cost economics (integer math, no float).
|
|
17
|
+
- Binary-Merkle withdrawal-proof assembly for the bridge.
|
|
18
|
+
- Portable rollup manifests (save / share / reload).
|
|
19
|
+
- Account derivation from a BIP-39 mnemonic (BIP-44 `m/44'/118'/0'/0/0`,
|
|
20
|
+
secp256k1, bech32 `qor`) and a SIGN_MODE_DIRECT signer.
|
|
21
|
+
- Hand-encoded protobuf codecs for the eight `rdk` messages, a full transaction
|
|
22
|
+
builder, and broadcast via the REST `/cosmos/tx/v1beta1/txs` endpoint.
|
|
23
|
+
- Read clients: REST (LCD), the `qor_` JSON-RPC namespace, typed views, and the
|
|
24
|
+
`RdkClient` facade — plus preflight ("doctor"), rollup health, event decoding,
|
|
25
|
+
and a faucet helper. Live broadcast requires a reachable node endpoint; the
|
|
26
|
+
HTTP transport is injectable for testing.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pip install qorechain-rdk
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
> Install as `qorechain-rdk`; import as `qorrdk`.
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from qorrdk import presets, create_rdk_client, signer_from_env
|
|
36
|
+
|
|
37
|
+
# Build and validate a rollup configuration.
|
|
38
|
+
config = presets.defi("my-rollup").set(stake_amount_uqor="10000000000").build()
|
|
39
|
+
|
|
40
|
+
# Connect, sign, and broadcast (needs a reachable node endpoint).
|
|
41
|
+
client = create_rdk_client(network="testnet")
|
|
42
|
+
signer = signer_from_env() # QORE_OPERATOR_PRIVATE_KEY_HEX or QORE_MNEMONIC
|
|
43
|
+
if signer is not None:
|
|
44
|
+
tx = client.connect_tx(signer)
|
|
45
|
+
tx.create_rollup(rollup_id="my-rollup", profile="defi", vm_type="evm",
|
|
46
|
+
stake_amount="10000000000")
|
|
47
|
+
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "qorechain-rdk"
|
|
7
|
+
version = "0.3.1"
|
|
8
|
+
description = "Python Rollup Development Kit for the QoreChain network."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "Apache-2.0" }
|
|
12
|
+
authors = [{ name = "QoreChain" }]
|
|
13
|
+
keywords = ["qorechain", "rollup", "rdk", "blockchain"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"License :: OSI Approved :: Apache Software License",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Typing :: Typed",
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"cosmpy>=0.9",
|
|
27
|
+
"requests>=2.28",
|
|
28
|
+
"bech32>=1.2",
|
|
29
|
+
"mnemonic>=0.20",
|
|
30
|
+
"ecdsa>=0.18",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = [
|
|
35
|
+
"pytest>=7.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://github.com/qorechain/qorechain-rdk"
|
|
40
|
+
Repository = "https://github.com/qorechain/qorechain-rdk"
|
|
41
|
+
|
|
42
|
+
[tool.setuptools.packages.find]
|
|
43
|
+
where = ["src"]
|
|
44
|
+
|
|
45
|
+
[tool.setuptools.package-data]
|
|
46
|
+
qorrdk = ["py.typed"]
|
|
47
|
+
|
|
48
|
+
[tool.pytest.ini_options]
|
|
49
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qorechain-rdk
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: Python Rollup Development Kit for the QoreChain network.
|
|
5
|
+
Author: QoreChain
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/qorechain/qorechain-rdk
|
|
8
|
+
Project-URL: Repository, https://github.com/qorechain/qorechain-rdk
|
|
9
|
+
Keywords: qorechain,rollup,rdk,blockchain
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: cosmpy>=0.9
|
|
22
|
+
Requires-Dist: requests>=2.28
|
|
23
|
+
Requires-Dist: bech32>=1.2
|
|
24
|
+
Requires-Dist: mnemonic>=0.20
|
|
25
|
+
Requires-Dist: ecdsa>=0.18
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
28
|
+
|
|
29
|
+
# qorechain-rdk (Python)
|
|
30
|
+
|
|
31
|
+
Python Rollup Development Kit for the QoreChain network.
|
|
32
|
+
|
|
33
|
+
**Status: Available.** This package mirrors the TypeScript RDK
|
|
34
|
+
(`@qorechain/rdk`) with idiomatic, type-hinted, snake_case Python — typed rollup
|
|
35
|
+
configuration with the compatibility matrix enforced, preset profiles, the
|
|
36
|
+
rollup and settlement-batch lifecycles, native data availability, transaction
|
|
37
|
+
signing and broadcast, and the read clients.
|
|
38
|
+
|
|
39
|
+
Surface (mirrors the TypeScript RDK modules):
|
|
40
|
+
|
|
41
|
+
- Typed rollup configuration and builder, with the settlement / sequencer /
|
|
42
|
+
proof / DA / gas / VM compatibility matrix validated client-side.
|
|
43
|
+
- The five preset profiles: `defi`, `gaming`, `nft`, `enterprise`, `custom`.
|
|
44
|
+
- Exact denom conversion and creation-cost economics (integer math, no float).
|
|
45
|
+
- Binary-Merkle withdrawal-proof assembly for the bridge.
|
|
46
|
+
- Portable rollup manifests (save / share / reload).
|
|
47
|
+
- Account derivation from a BIP-39 mnemonic (BIP-44 `m/44'/118'/0'/0/0`,
|
|
48
|
+
secp256k1, bech32 `qor`) and a SIGN_MODE_DIRECT signer.
|
|
49
|
+
- Hand-encoded protobuf codecs for the eight `rdk` messages, a full transaction
|
|
50
|
+
builder, and broadcast via the REST `/cosmos/tx/v1beta1/txs` endpoint.
|
|
51
|
+
- Read clients: REST (LCD), the `qor_` JSON-RPC namespace, typed views, and the
|
|
52
|
+
`RdkClient` facade — plus preflight ("doctor"), rollup health, event decoding,
|
|
53
|
+
and a faucet helper. Live broadcast requires a reachable node endpoint; the
|
|
54
|
+
HTTP transport is injectable for testing.
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
pip install qorechain-rdk
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> Install as `qorechain-rdk`; import as `qorrdk`.
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from qorrdk import presets, create_rdk_client, signer_from_env
|
|
64
|
+
|
|
65
|
+
# Build and validate a rollup configuration.
|
|
66
|
+
config = presets.defi("my-rollup").set(stake_amount_uqor="10000000000").build()
|
|
67
|
+
|
|
68
|
+
# Connect, sign, and broadcast (needs a reachable node endpoint).
|
|
69
|
+
client = create_rdk_client(network="testnet")
|
|
70
|
+
signer = signer_from_env() # QORE_OPERATOR_PRIVATE_KEY_HEX or QORE_MNEMONIC
|
|
71
|
+
if signer is not None:
|
|
72
|
+
tx = client.connect_tx(signer)
|
|
73
|
+
tx.create_rollup(rollup_id="my-rollup", profile="defi", vm_type="evm",
|
|
74
|
+
stake_amount="10000000000")
|
|
75
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/qorechain_rdk.egg-info/PKG-INFO
|
|
4
|
+
src/qorechain_rdk.egg-info/SOURCES.txt
|
|
5
|
+
src/qorechain_rdk.egg-info/dependency_links.txt
|
|
6
|
+
src/qorechain_rdk.egg-info/requires.txt
|
|
7
|
+
src/qorechain_rdk.egg-info/top_level.txt
|
|
8
|
+
src/qorrdk/__init__.py
|
|
9
|
+
src/qorrdk/constants.py
|
|
10
|
+
src/qorrdk/enums.py
|
|
11
|
+
src/qorrdk/presets.py
|
|
12
|
+
src/qorrdk/profiles.py
|
|
13
|
+
src/qorrdk/py.typed
|
|
14
|
+
src/qorrdk/accounts/__init__.py
|
|
15
|
+
src/qorrdk/accounts/wallet.py
|
|
16
|
+
src/qorrdk/bridge/__init__.py
|
|
17
|
+
src/qorrdk/bridge/merkle.py
|
|
18
|
+
src/qorrdk/bridge/withdrawal.py
|
|
19
|
+
src/qorrdk/client/__init__.py
|
|
20
|
+
src/qorrdk/client/http.py
|
|
21
|
+
src/qorrdk/client/jsonrpc.py
|
|
22
|
+
src/qorrdk/client/rdk_client.py
|
|
23
|
+
src/qorrdk/client/rest.py
|
|
24
|
+
src/qorrdk/client/views.py
|
|
25
|
+
src/qorrdk/config/__init__.py
|
|
26
|
+
src/qorrdk/config/builder.py
|
|
27
|
+
src/qorrdk/config/errors.py
|
|
28
|
+
src/qorrdk/config/matrix.py
|
|
29
|
+
src/qorrdk/config/networks.py
|
|
30
|
+
src/qorrdk/config/types.py
|
|
31
|
+
src/qorrdk/config/validate.py
|
|
32
|
+
src/qorrdk/da/__init__.py
|
|
33
|
+
src/qorrdk/events/__init__.py
|
|
34
|
+
src/qorrdk/events/decode.py
|
|
35
|
+
src/qorrdk/faucet/__init__.py
|
|
36
|
+
src/qorrdk/health/__init__.py
|
|
37
|
+
src/qorrdk/lifecycle/__init__.py
|
|
38
|
+
src/qorrdk/lifecycle/state_machine.py
|
|
39
|
+
src/qorrdk/manifest/__init__.py
|
|
40
|
+
src/qorrdk/monitor/__init__.py
|
|
41
|
+
src/qorrdk/preflight/__init__.py
|
|
42
|
+
src/qorrdk/tx/__init__.py
|
|
43
|
+
src/qorrdk/tx/client.py
|
|
44
|
+
src/qorrdk/tx/codecs.py
|
|
45
|
+
src/qorrdk/tx/messages.py
|
|
46
|
+
src/qorrdk/tx/mock.py
|
|
47
|
+
src/qorrdk/utils/__init__.py
|
|
48
|
+
src/qorrdk/utils/bech32.py
|
|
49
|
+
src/qorrdk/utils/bytes.py
|
|
50
|
+
src/qorrdk/utils/denom.py
|
|
51
|
+
src/qorrdk/utils/economics.py
|
|
52
|
+
tests/test_accounts.py
|
|
53
|
+
tests/test_bridge.py
|
|
54
|
+
tests/test_client.py
|
|
55
|
+
tests/test_config.py
|
|
56
|
+
tests/test_manifest.py
|
|
57
|
+
tests/test_misc.py
|
|
58
|
+
tests/test_monitor.py
|
|
59
|
+
tests/test_presets.py
|
|
60
|
+
tests/test_tx.py
|
|
61
|
+
tests/test_tx_mock.py
|
|
62
|
+
tests/test_utils.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
qorrdk
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
"""Python Rollup Development Kit for the QoreChain network.
|
|
2
|
+
|
|
3
|
+
The Rollup Development Kit drives the on-chain ``rdk`` module: rollup
|
|
4
|
+
configuration and creation, the rollup and settlement-batch lifecycles, native
|
|
5
|
+
data availability, transaction signing and broadcast, and the read surface (REST
|
|
6
|
+
and the ``qor_`` JSON-RPC namespace), plus a QCAI-assisted profile recommendation.
|
|
7
|
+
|
|
8
|
+
This mirrors the TypeScript RDK (``@qorechain/rdk``) with idiomatic, snake_case
|
|
9
|
+
Python. Live broadcast requires a reachable node endpoint; everything else
|
|
10
|
+
(config, presets, economics, Merkle proofs, manifests, message encoding, and
|
|
11
|
+
account derivation) works fully offline.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
__version__ = "0.3.1"
|
|
17
|
+
|
|
18
|
+
# Constants.
|
|
19
|
+
from .constants import ( # noqa: E402
|
|
20
|
+
ACCOUNT_PREFIX,
|
|
21
|
+
BASE_DENOM,
|
|
22
|
+
CHAIN_IDS,
|
|
23
|
+
DEFAULT_CHALLENGE_BOND_UQOR,
|
|
24
|
+
DEFAULT_RDK_PARAMS,
|
|
25
|
+
DENOM_EXPONENT,
|
|
26
|
+
DISPLAY_DENOM,
|
|
27
|
+
NETWORK_NAMES,
|
|
28
|
+
VALIDATOR_PREFIX,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
# Enums.
|
|
32
|
+
from .enums import ( # noqa: E402
|
|
33
|
+
BATCH_STATUSES,
|
|
34
|
+
DA_BACKENDS,
|
|
35
|
+
GAS_MODELS,
|
|
36
|
+
PROFILE_NAMES,
|
|
37
|
+
PROOF_SYSTEMS,
|
|
38
|
+
ROLLUP_STATUSES,
|
|
39
|
+
SEQUENCER_MODES,
|
|
40
|
+
SETTLEMENT_PARADIGMS,
|
|
41
|
+
VM_TYPES,
|
|
42
|
+
BatchStatus,
|
|
43
|
+
DABackend,
|
|
44
|
+
GasModel,
|
|
45
|
+
ProfileName,
|
|
46
|
+
ProofSystem,
|
|
47
|
+
RollupStatus,
|
|
48
|
+
SequencerMode,
|
|
49
|
+
SettlementParadigm,
|
|
50
|
+
VmType,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# Configuration: types, networks, matrix, validation, builder.
|
|
54
|
+
from .config import ( # noqa: E402
|
|
55
|
+
NETWORKS,
|
|
56
|
+
CreateRollupMsgInput,
|
|
57
|
+
Endpoints,
|
|
58
|
+
NetworkConfig,
|
|
59
|
+
RollupConfig,
|
|
60
|
+
RollupConfigBuilder,
|
|
61
|
+
RollupConfigError,
|
|
62
|
+
SequencerParams,
|
|
63
|
+
SETTLEMENT_PROOF_MATRIX,
|
|
64
|
+
ValidationResult,
|
|
65
|
+
assert_valid_rollup_config,
|
|
66
|
+
get_network,
|
|
67
|
+
is_proof_compatible,
|
|
68
|
+
list_networks,
|
|
69
|
+
requires_based_sequencer,
|
|
70
|
+
valid_proof_systems,
|
|
71
|
+
validate_rollup_config,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
# Preset profiles.
|
|
75
|
+
from .presets import PRESET_DEFAULTS, presets # noqa: E402
|
|
76
|
+
|
|
77
|
+
# Utilities.
|
|
78
|
+
from .utils import ( # noqa: E402
|
|
79
|
+
CreationCost,
|
|
80
|
+
bech32_prefix,
|
|
81
|
+
bech32_to_hex,
|
|
82
|
+
bytes_to_hex,
|
|
83
|
+
estimate_creation_cost,
|
|
84
|
+
hex_to_bech32,
|
|
85
|
+
hex_to_bytes,
|
|
86
|
+
mul_decimal_floor,
|
|
87
|
+
qor_to_uqor,
|
|
88
|
+
to_bytes,
|
|
89
|
+
uqor_to_qor,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# Lifecycle.
|
|
93
|
+
from .lifecycle import ( # noqa: E402
|
|
94
|
+
BATCH_TRANSITIONS,
|
|
95
|
+
ROLLUP_ACTION_FROM,
|
|
96
|
+
assert_rollup_action,
|
|
97
|
+
can_perform_rollup_action,
|
|
98
|
+
challenge_window_deadline,
|
|
99
|
+
is_batch_final,
|
|
100
|
+
is_challenge_window_closed,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
# Data availability.
|
|
104
|
+
from .da import ( # noqa: E402
|
|
105
|
+
DA_CELESTIA_UNAVAILABLE_MESSAGE,
|
|
106
|
+
DaBlob,
|
|
107
|
+
assert_da_backend_available,
|
|
108
|
+
build_da_blob,
|
|
109
|
+
is_da_backend_available,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
# Bridge.
|
|
113
|
+
from .bridge import ( # noqa: E402
|
|
114
|
+
MerkleOptions,
|
|
115
|
+
MerkleProof,
|
|
116
|
+
WithdrawalProof,
|
|
117
|
+
assemble_withdrawal_proof,
|
|
118
|
+
binary_merkle_proof,
|
|
119
|
+
binary_merkle_root,
|
|
120
|
+
build_execute_withdrawal_input,
|
|
121
|
+
verify_binary_merkle_proof,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
# Manifest.
|
|
125
|
+
from .manifest import ( # noqa: E402
|
|
126
|
+
MANIFEST_SCHEMA,
|
|
127
|
+
RollupManifest,
|
|
128
|
+
from_manifest,
|
|
129
|
+
manifest_from_dict,
|
|
130
|
+
manifest_to_dict,
|
|
131
|
+
parse_manifest,
|
|
132
|
+
stringify_manifest,
|
|
133
|
+
to_manifest,
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
# Events.
|
|
137
|
+
from .events import ( # noqa: E402
|
|
138
|
+
RDK_EVENT_TYPES,
|
|
139
|
+
DecodedRdkEvent,
|
|
140
|
+
RawEvent,
|
|
141
|
+
decode_rdk_events,
|
|
142
|
+
find_rdk_event,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
# Transactions.
|
|
146
|
+
from .tx import ( # noqa: E402
|
|
147
|
+
BroadcastResult,
|
|
148
|
+
ChallengeBatchInput,
|
|
149
|
+
CreateRollupInput,
|
|
150
|
+
EncodedMsg,
|
|
151
|
+
ExecuteWithdrawalInput,
|
|
152
|
+
MockCall,
|
|
153
|
+
MockTxClient,
|
|
154
|
+
PauseRollupInput,
|
|
155
|
+
RdkTxClient,
|
|
156
|
+
ResolveChallengeInput,
|
|
157
|
+
RollupRefInput,
|
|
158
|
+
SignAndBroadcastBackend,
|
|
159
|
+
SubmitBatchInput,
|
|
160
|
+
TxOptions,
|
|
161
|
+
challenge_batch_msg,
|
|
162
|
+
create_rollup_msg,
|
|
163
|
+
execute_withdrawal_msg,
|
|
164
|
+
pause_rollup_msg,
|
|
165
|
+
resolve_challenge_msg,
|
|
166
|
+
resume_rollup_msg,
|
|
167
|
+
stop_rollup_msg,
|
|
168
|
+
submit_batch_msg,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
# Accounts & signing.
|
|
172
|
+
from .accounts import ( # noqa: E402
|
|
173
|
+
NativeAccount,
|
|
174
|
+
Signer,
|
|
175
|
+
derive_native_account,
|
|
176
|
+
generate_mnemonic,
|
|
177
|
+
signer_from_env,
|
|
178
|
+
signer_from_private_key,
|
|
179
|
+
validate_mnemonic,
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
# Read clients & facade.
|
|
183
|
+
from .client import ( # noqa: E402
|
|
184
|
+
BatchView,
|
|
185
|
+
HttpResponse,
|
|
186
|
+
ParamsView,
|
|
187
|
+
QorClient,
|
|
188
|
+
RdkClient,
|
|
189
|
+
RestClient,
|
|
190
|
+
RollupView,
|
|
191
|
+
Transport,
|
|
192
|
+
create_rdk_client,
|
|
193
|
+
default_transport,
|
|
194
|
+
map_batch_view,
|
|
195
|
+
map_params_view,
|
|
196
|
+
map_rollup_view,
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
# Profile suggestion.
|
|
200
|
+
from .profiles import ProfileSuggestion, suggest_profile # noqa: E402
|
|
201
|
+
|
|
202
|
+
# Preflight, health, faucet.
|
|
203
|
+
from .preflight import PreflightCheck, PreflightResult, check_preflight # noqa: E402
|
|
204
|
+
from .health import RollupHealth, get_rollup_health # noqa: E402
|
|
205
|
+
from .faucet import FaucetResult, request_faucet # noqa: E402
|
|
206
|
+
|
|
207
|
+
# Live monitoring.
|
|
208
|
+
from .monitor import Watcher, events_from_tx_hash, watch_rollup # noqa: E402
|
|
209
|
+
|
|
210
|
+
__all__ = [
|
|
211
|
+
"__version__",
|
|
212
|
+
# constants
|
|
213
|
+
"DISPLAY_DENOM",
|
|
214
|
+
"BASE_DENOM",
|
|
215
|
+
"DENOM_EXPONENT",
|
|
216
|
+
"ACCOUNT_PREFIX",
|
|
217
|
+
"VALIDATOR_PREFIX",
|
|
218
|
+
"CHAIN_IDS",
|
|
219
|
+
"NETWORK_NAMES",
|
|
220
|
+
"DEFAULT_RDK_PARAMS",
|
|
221
|
+
"DEFAULT_CHALLENGE_BOND_UQOR",
|
|
222
|
+
# enums
|
|
223
|
+
"SettlementParadigm",
|
|
224
|
+
"SequencerMode",
|
|
225
|
+
"ProofSystem",
|
|
226
|
+
"DABackend",
|
|
227
|
+
"GasModel",
|
|
228
|
+
"VmType",
|
|
229
|
+
"RollupStatus",
|
|
230
|
+
"BatchStatus",
|
|
231
|
+
"ProfileName",
|
|
232
|
+
"SETTLEMENT_PARADIGMS",
|
|
233
|
+
"SEQUENCER_MODES",
|
|
234
|
+
"PROOF_SYSTEMS",
|
|
235
|
+
"DA_BACKENDS",
|
|
236
|
+
"GAS_MODELS",
|
|
237
|
+
"VM_TYPES",
|
|
238
|
+
"ROLLUP_STATUSES",
|
|
239
|
+
"BATCH_STATUSES",
|
|
240
|
+
"PROFILE_NAMES",
|
|
241
|
+
# config
|
|
242
|
+
"RollupConfig",
|
|
243
|
+
"SequencerParams",
|
|
244
|
+
"CreateRollupMsgInput",
|
|
245
|
+
"RollupConfigBuilder",
|
|
246
|
+
"RollupConfigError",
|
|
247
|
+
"ValidationResult",
|
|
248
|
+
"validate_rollup_config",
|
|
249
|
+
"assert_valid_rollup_config",
|
|
250
|
+
"SETTLEMENT_PROOF_MATRIX",
|
|
251
|
+
"valid_proof_systems",
|
|
252
|
+
"is_proof_compatible",
|
|
253
|
+
"requires_based_sequencer",
|
|
254
|
+
"Endpoints",
|
|
255
|
+
"NetworkConfig",
|
|
256
|
+
"NETWORKS",
|
|
257
|
+
"get_network",
|
|
258
|
+
"list_networks",
|
|
259
|
+
# presets
|
|
260
|
+
"PRESET_DEFAULTS",
|
|
261
|
+
"presets",
|
|
262
|
+
# utils
|
|
263
|
+
"qor_to_uqor",
|
|
264
|
+
"uqor_to_qor",
|
|
265
|
+
"mul_decimal_floor",
|
|
266
|
+
"estimate_creation_cost",
|
|
267
|
+
"CreationCost",
|
|
268
|
+
"bech32_to_hex",
|
|
269
|
+
"hex_to_bech32",
|
|
270
|
+
"bech32_prefix",
|
|
271
|
+
"bytes_to_hex",
|
|
272
|
+
"hex_to_bytes",
|
|
273
|
+
"to_bytes",
|
|
274
|
+
# lifecycle
|
|
275
|
+
"ROLLUP_ACTION_FROM",
|
|
276
|
+
"can_perform_rollup_action",
|
|
277
|
+
"assert_rollup_action",
|
|
278
|
+
"BATCH_TRANSITIONS",
|
|
279
|
+
"is_batch_final",
|
|
280
|
+
"challenge_window_deadline",
|
|
281
|
+
"is_challenge_window_closed",
|
|
282
|
+
# da
|
|
283
|
+
"DA_CELESTIA_UNAVAILABLE_MESSAGE",
|
|
284
|
+
"DaBlob",
|
|
285
|
+
"build_da_blob",
|
|
286
|
+
"is_da_backend_available",
|
|
287
|
+
"assert_da_backend_available",
|
|
288
|
+
# bridge
|
|
289
|
+
"MerkleOptions",
|
|
290
|
+
"MerkleProof",
|
|
291
|
+
"binary_merkle_root",
|
|
292
|
+
"binary_merkle_proof",
|
|
293
|
+
"verify_binary_merkle_proof",
|
|
294
|
+
"WithdrawalProof",
|
|
295
|
+
"assemble_withdrawal_proof",
|
|
296
|
+
"build_execute_withdrawal_input",
|
|
297
|
+
# manifest
|
|
298
|
+
"MANIFEST_SCHEMA",
|
|
299
|
+
"RollupManifest",
|
|
300
|
+
"to_manifest",
|
|
301
|
+
"from_manifest",
|
|
302
|
+
"manifest_to_dict",
|
|
303
|
+
"manifest_from_dict",
|
|
304
|
+
"stringify_manifest",
|
|
305
|
+
"parse_manifest",
|
|
306
|
+
# events
|
|
307
|
+
"RDK_EVENT_TYPES",
|
|
308
|
+
"RawEvent",
|
|
309
|
+
"DecodedRdkEvent",
|
|
310
|
+
"decode_rdk_events",
|
|
311
|
+
"find_rdk_event",
|
|
312
|
+
# tx
|
|
313
|
+
"EncodedMsg",
|
|
314
|
+
"CreateRollupInput",
|
|
315
|
+
"SubmitBatchInput",
|
|
316
|
+
"ChallengeBatchInput",
|
|
317
|
+
"ResolveChallengeInput",
|
|
318
|
+
"PauseRollupInput",
|
|
319
|
+
"RollupRefInput",
|
|
320
|
+
"ExecuteWithdrawalInput",
|
|
321
|
+
"create_rollup_msg",
|
|
322
|
+
"submit_batch_msg",
|
|
323
|
+
"challenge_batch_msg",
|
|
324
|
+
"resolve_challenge_msg",
|
|
325
|
+
"pause_rollup_msg",
|
|
326
|
+
"resume_rollup_msg",
|
|
327
|
+
"stop_rollup_msg",
|
|
328
|
+
"execute_withdrawal_msg",
|
|
329
|
+
"RdkTxClient",
|
|
330
|
+
"TxOptions",
|
|
331
|
+
"BroadcastResult",
|
|
332
|
+
"SignAndBroadcastBackend",
|
|
333
|
+
"MockTxClient",
|
|
334
|
+
"MockCall",
|
|
335
|
+
# accounts
|
|
336
|
+
"NativeAccount",
|
|
337
|
+
"Signer",
|
|
338
|
+
"derive_native_account",
|
|
339
|
+
"generate_mnemonic",
|
|
340
|
+
"validate_mnemonic",
|
|
341
|
+
"signer_from_private_key",
|
|
342
|
+
"signer_from_env",
|
|
343
|
+
# clients
|
|
344
|
+
"Transport",
|
|
345
|
+
"HttpResponse",
|
|
346
|
+
"default_transport",
|
|
347
|
+
"RestClient",
|
|
348
|
+
"QorClient",
|
|
349
|
+
"RdkClient",
|
|
350
|
+
"create_rdk_client",
|
|
351
|
+
"ParamsView",
|
|
352
|
+
"RollupView",
|
|
353
|
+
"BatchView",
|
|
354
|
+
"map_params_view",
|
|
355
|
+
"map_rollup_view",
|
|
356
|
+
"map_batch_view",
|
|
357
|
+
# profiles
|
|
358
|
+
"ProfileSuggestion",
|
|
359
|
+
"suggest_profile",
|
|
360
|
+
# preflight / health / faucet
|
|
361
|
+
"PreflightCheck",
|
|
362
|
+
"PreflightResult",
|
|
363
|
+
"check_preflight",
|
|
364
|
+
"RollupHealth",
|
|
365
|
+
"get_rollup_health",
|
|
366
|
+
"FaucetResult",
|
|
367
|
+
"request_faucet",
|
|
368
|
+
# monitor
|
|
369
|
+
"Watcher",
|
|
370
|
+
"events_from_tx_hash",
|
|
371
|
+
"watch_rollup",
|
|
372
|
+
]
|