primecli 0.9.0__tar.gz → 0.9.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.
- {primecli-0.9.0 → primecli-0.9.1}/PKG-INFO +2 -2
- {primecli-0.9.0 → primecli-0.9.1}/README.md +1 -1
- {primecli-0.9.0 → primecli-0.9.1}/primecli/degenprime.py +49 -42
- {primecli-0.9.0 → primecli-0.9.1}/primecli.egg-info/PKG-INFO +2 -2
- {primecli-0.9.0 → primecli-0.9.1}/pyproject.toml +1 -1
- {primecli-0.9.0 → primecli-0.9.1}/LICENSE +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/primecli/__init__.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/primecli/arbprime.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/primecli/deltaprime.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/primecli/health_monitor.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/primecli.egg-info/SOURCES.txt +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/primecli.egg-info/dependency_links.txt +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/primecli.egg-info/entry_points.txt +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/primecli.egg-info/requires.txt +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/primecli.egg-info/top_level.txt +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/setup.cfg +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/tests/test_aero_rebalance.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/tests/test_cross_file_identity.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/tests/test_gas_limit.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/tests/test_gas_pricing.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/tests/test_health_meter.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/tests/test_health_monitor.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/tests/test_paraswap_validator.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/tests/test_redstone_encoding.py +0 -0
- {primecli-0.9.0 → primecli-0.9.1}/tests/test_to_wei_units.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: primecli
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.1
|
|
4
4
|
Summary: Agent-friendly CLI tools for the DeltaPrime (Avalanche + Arbitrum) and DegenPrime (Base) lending and leverage protocols. Preview-by-default; no Etherscan key required.
|
|
5
5
|
Author: Mnemosyne-quest contributors
|
|
6
6
|
License: MIT
|
|
@@ -47,7 +47,7 @@ Built for agent use:
|
|
|
47
47
|
- RedStone-signed solvency math handled internally, with a regression test pinning the half-boundary `toFixed(8)` encoding.
|
|
48
48
|
- ParaSwap calldata validated client-side against the on-chain executor allowlist before broadcast.
|
|
49
49
|
|
|
50
|
-
**Current version:** 0.9.
|
|
50
|
+
**Current version:** 0.9.1 The 0.x line is pre-1.0, so breaking changes are possible. See [Releases](https://github.com/Mnemosyne-quest/primecli/releases).
|
|
51
51
|
|
|
52
52
|
> **Breaking change in 0.5.0:** there is no longer a default signing key. Earlier versions silently fell back to a baked-in agent when no key was configured; that fallback has been removed. With no key configured, every command now fails closed with `No signing key found...`. Set a key explicitly (see [Configuration](#configuration)).
|
|
53
53
|
|
|
@@ -16,7 +16,7 @@ Built for agent use:
|
|
|
16
16
|
- RedStone-signed solvency math handled internally, with a regression test pinning the half-boundary `toFixed(8)` encoding.
|
|
17
17
|
- ParaSwap calldata validated client-side against the on-chain executor allowlist before broadcast.
|
|
18
18
|
|
|
19
|
-
**Current version:** 0.9.
|
|
19
|
+
**Current version:** 0.9.1 The 0.x line is pre-1.0, so breaking changes are possible. See [Releases](https://github.com/Mnemosyne-quest/primecli/releases).
|
|
20
20
|
|
|
21
21
|
> **Breaking change in 0.5.0:** there is no longer a default signing key. Earlier versions silently fell back to a baked-in agent when no key was configured; that fallback has been removed. With no key configured, every command now fails closed with `No signing key found...`. Set a key explicitly (see [Configuration](#configuration)).
|
|
22
22
|
|
|
@@ -4353,8 +4353,10 @@ def _aero_rebalance_events(account: str, from_block=None, to_block="latest"):
|
|
|
4353
4353
|
if from_block is None:
|
|
4354
4354
|
# The shared emitter went live with the 2026-06-16 migration; a recent window
|
|
4355
4355
|
# covers all post-migration history. Public Base RPCs cap getLogs at 50k blocks,
|
|
4356
|
-
# so default to ~
|
|
4357
|
-
|
|
4356
|
+
# so default to ~90k blocks back (≈50h at 2s/block, covering the 48h KO window)
|
|
4357
|
+
# and page under the cap. All four event types are fetched in ONE getLogs per
|
|
4358
|
+
# chunk (topic0 OR-list) below, so this stays fast enough for a per-tick call.
|
|
4359
|
+
from_block = max(0, latest - 90_000)
|
|
4358
4360
|
# Non-indexed arg types per event (indexed userContract/user/tokenId/executor live
|
|
4359
4361
|
# in the topics, not the data blob).
|
|
4360
4362
|
nonindexed = {
|
|
@@ -4364,47 +4366,52 @@ def _aero_rebalance_events(account: str, from_block=None, to_block="latest"):
|
|
|
4364
4366
|
"RebalanceExecuted": ["uint160", "uint160", "uint256", "uint256"],
|
|
4365
4367
|
}
|
|
4366
4368
|
CHUNK = 45_000 # under the public-RPC 50k-block getLogs cap
|
|
4369
|
+
# Reverse map topic0 -> event name so a SINGLE getLogs (topic0 as an OR-list) returns
|
|
4370
|
+
# all four event types per chunk, then is demuxed here. One scan per event type
|
|
4371
|
+
# (the previous approach) meant 4x the getLogs round-trips, which timed out the
|
|
4372
|
+
# per-tick range-monitor call.
|
|
4373
|
+
t0_to_name = {t.lower().removeprefix("0x"): n for n, t in REBALANCE_TOPIC0.items()}
|
|
4374
|
+
all_topic0 = list(REBALANCE_TOPIC0.values())
|
|
4367
4375
|
out = []
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
start
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
out.append(ev)
|
|
4376
|
+
start = from_block
|
|
4377
|
+
try:
|
|
4378
|
+
while start <= to_block:
|
|
4379
|
+
end = min(start + CHUNK - 1, to_block)
|
|
4380
|
+
chunk_logs = w3.eth.get_logs({"address": emitter, "fromBlock": start,
|
|
4381
|
+
"toBlock": end, "topics": [all_topic0, acct_topic]})
|
|
4382
|
+
for lg in chunk_logs:
|
|
4383
|
+
name = t0_to_name.get(lg["topics"][0].hex().lower().removeprefix("0x"))
|
|
4384
|
+
if name is None:
|
|
4385
|
+
continue
|
|
4386
|
+
ev = {"event": name, "block": lg["blockNumber"],
|
|
4387
|
+
"logIndex": lg["logIndex"], "tx": lg["transactionHash"].hex()}
|
|
4388
|
+
# topic2 is executor (Executed); topic3 is the tokenId (all four events).
|
|
4389
|
+
topics = lg["topics"]
|
|
4390
|
+
decoded = w3.codec.decode(nonindexed[name], bytes(lg["data"]))
|
|
4391
|
+
if name == "RebalanceExecuted":
|
|
4392
|
+
ev["executor"] = "0x" + topics[2].hex()[-40:]
|
|
4393
|
+
ev["tokenId"] = int(topics[3].hex(), 16)
|
|
4394
|
+
ev["oldRefSqrtPriceX96"] = decoded[0]
|
|
4395
|
+
ev["currentSqrtPriceX96"] = decoded[1]
|
|
4396
|
+
ev["newTokenId"] = decoded[2]
|
|
4397
|
+
ev["timestamp"] = decoded[3]
|
|
4398
|
+
else:
|
|
4399
|
+
ev["tokenId"] = int(topics[3].hex(), 16) if len(topics) > 3 else None
|
|
4400
|
+
if name == "RebalanceOrderCreated":
|
|
4401
|
+
ev["rangeBps"] = [decoded[0], decoded[1]]
|
|
4402
|
+
ev["triggerBps"] = [decoded[2], decoded[3]]
|
|
4403
|
+
ev["executionFeeWeth"] = decoded[4]
|
|
4404
|
+
ev["timestamp"] = decoded[5]
|
|
4405
|
+
elif name == "RebalanceOrderUpdated":
|
|
4406
|
+
ev["rangeBps"] = [decoded[0], decoded[1]]
|
|
4407
|
+
ev["triggerBps"] = [decoded[2], decoded[3]]
|
|
4408
|
+
ev["timestamp"] = decoded[4]
|
|
4409
|
+
elif name == "RebalanceOrderCanceled":
|
|
4410
|
+
ev["timestamp"] = decoded[0]
|
|
4411
|
+
out.append(ev)
|
|
4412
|
+
start = end + 1
|
|
4413
|
+
except Exception as e:
|
|
4414
|
+
print(f" (getLogs failed: {type(e).__name__}: {str(e)[:120]})")
|
|
4408
4415
|
out.sort(key=lambda e: (e["block"], e["logIndex"]))
|
|
4409
4416
|
return out
|
|
4410
4417
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: primecli
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.1
|
|
4
4
|
Summary: Agent-friendly CLI tools for the DeltaPrime (Avalanche + Arbitrum) and DegenPrime (Base) lending and leverage protocols. Preview-by-default; no Etherscan key required.
|
|
5
5
|
Author: Mnemosyne-quest contributors
|
|
6
6
|
License: MIT
|
|
@@ -47,7 +47,7 @@ Built for agent use:
|
|
|
47
47
|
- RedStone-signed solvency math handled internally, with a regression test pinning the half-boundary `toFixed(8)` encoding.
|
|
48
48
|
- ParaSwap calldata validated client-side against the on-chain executor allowlist before broadcast.
|
|
49
49
|
|
|
50
|
-
**Current version:** 0.9.
|
|
50
|
+
**Current version:** 0.9.1 The 0.x line is pre-1.0, so breaking changes are possible. See [Releases](https://github.com/Mnemosyne-quest/primecli/releases).
|
|
51
51
|
|
|
52
52
|
> **Breaking change in 0.5.0:** there is no longer a default signing key. Earlier versions silently fell back to a baked-in agent when no key was configured; that fallback has been removed. With no key configured, every command now fails closed with `No signing key found...`. Set a key explicitly (see [Configuration](#configuration)).
|
|
53
53
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "primecli"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.1"
|
|
8
8
|
description = "Agent-friendly CLI tools for the DeltaPrime (Avalanche + Arbitrum) and DegenPrime (Base) lending and leverage protocols. Preview-by-default; no Etherscan key required."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
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
|