primecli 0.7.0__tar.gz → 0.7.2__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.
Files changed (23) hide show
  1. {primecli-0.7.0 → primecli-0.7.2}/PKG-INFO +1 -1
  2. {primecli-0.7.0 → primecli-0.7.2}/primecli/degenprime.py +9 -17
  3. {primecli-0.7.0 → primecli-0.7.2}/primecli.egg-info/PKG-INFO +1 -1
  4. {primecli-0.7.0 → primecli-0.7.2}/pyproject.toml +1 -1
  5. {primecli-0.7.0 → primecli-0.7.2}/LICENSE +0 -0
  6. {primecli-0.7.0 → primecli-0.7.2}/README.md +0 -0
  7. {primecli-0.7.0 → primecli-0.7.2}/primecli/__init__.py +0 -0
  8. {primecli-0.7.0 → primecli-0.7.2}/primecli/arbprime.py +0 -0
  9. {primecli-0.7.0 → primecli-0.7.2}/primecli/deltaprime.py +0 -0
  10. {primecli-0.7.0 → primecli-0.7.2}/primecli/health_monitor.py +0 -0
  11. {primecli-0.7.0 → primecli-0.7.2}/primecli.egg-info/SOURCES.txt +0 -0
  12. {primecli-0.7.0 → primecli-0.7.2}/primecli.egg-info/dependency_links.txt +0 -0
  13. {primecli-0.7.0 → primecli-0.7.2}/primecli.egg-info/entry_points.txt +0 -0
  14. {primecli-0.7.0 → primecli-0.7.2}/primecli.egg-info/requires.txt +0 -0
  15. {primecli-0.7.0 → primecli-0.7.2}/primecli.egg-info/top_level.txt +0 -0
  16. {primecli-0.7.0 → primecli-0.7.2}/setup.cfg +0 -0
  17. {primecli-0.7.0 → primecli-0.7.2}/tests/test_cross_file_identity.py +0 -0
  18. {primecli-0.7.0 → primecli-0.7.2}/tests/test_gas_pricing.py +0 -0
  19. {primecli-0.7.0 → primecli-0.7.2}/tests/test_health_meter.py +0 -0
  20. {primecli-0.7.0 → primecli-0.7.2}/tests/test_health_monitor.py +0 -0
  21. {primecli-0.7.0 → primecli-0.7.2}/tests/test_paraswap_validator.py +0 -0
  22. {primecli-0.7.0 → primecli-0.7.2}/tests/test_redstone_encoding.py +0 -0
  23. {primecli-0.7.0 → primecli-0.7.2}/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.7.0
3
+ Version: 0.7.2
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
@@ -1114,7 +1114,9 @@ def build_redstone_payload(symbols: list) -> bytes:
1114
1114
  # Metadata = rest of timestamp + version + data service ID + null terminator
1115
1115
  signed_metadata = f"{ts_str[1:]}#0.9.0#{REDSTONE_DATA_SERVICE}\0".encode()
1116
1116
  payload += signed_metadata
1117
- payload += len(signed_metadata).to_bytes(2, "big")
1117
+ # Unsigned metadata size = padding(3) + ts_digit(1) + signed_metadata
1118
+ unsigned_meta_size = len(signed_metadata) + 4
1119
+ payload += unsigned_meta_size.to_bytes(3, "big")
1118
1120
  payload += REDSTONE_MARKER
1119
1121
  return payload
1120
1122
 
@@ -2150,9 +2152,7 @@ def cmd_borrow(pool_name: str, amount: float, execute: bool = False):
2150
2152
  pa_cs = Web3.to_checksum_address(pa)
2151
2153
  account = w3.eth.contract(address=pa_cs, abi=PRIME_ACCOUNT_ABI)
2152
2154
  # borrow has remainsSolvent -> needs RedStone price payload appended to calldata.
2153
- feeds = degen_account_price_feeds(account)
2154
- if symbol in REDSTONE_AVAILABLE_FEEDS and symbol not in feeds:
2155
- feeds.append(symbol)
2155
+ feeds = sorted(REDSTONE_AVAILABLE_FEEDS)
2156
2156
  payload = build_redstone_payload(feeds)
2157
2157
  base_calldata = account.encode_abi("borrow", args=[asset_b32(symbol), amount_wei])
2158
2158
  data = base_calldata + payload.hex()
@@ -2472,10 +2472,7 @@ def cmd_swap(from_sym: str, to_sym: str, amount: float, slippage_pct: float = 1.
2472
2472
  # Simulate-first executor handling (see cmd_swap_debt rationale): keep the API
2473
2473
  # executor when the exact tx simulates clean; only fall back to the legacy
2474
2474
  # executor if the unpatched calldata reverts.
2475
- feeds = degen_account_price_feeds(account)
2476
- for s in (from_sym, to_sym):
2477
- if s in REDSTONE_AVAILABLE_FEEDS and s not in feeds:
2478
- feeds.append(s)
2475
+ feeds = sorted(REDSTONE_AVAILABLE_FEEDS)
2479
2476
  payload = build_redstone_payload(feeds)
2480
2477
  def _sim_paraswap(db):
2481
2478
  base = account.encode_abi("paraSwapV6", args=[full[:4], db])
@@ -2599,10 +2596,7 @@ def cmd_swap_debt(from_sym: str, to_sym: str, amount: float, slippage_pct: float
2599
2596
  return
2600
2597
  repay_amount = min(to_wei_units(amount, from_cfg["decimals"]), borrowed)
2601
2598
 
2602
- feeds = degen_account_price_feeds(account)
2603
- for s in (from_sym, to_sym):
2604
- if s not in feeds:
2605
- feeds.append(s)
2599
+ feeds = sorted(REDSTONE_AVAILABLE_FEEDS)
2606
2600
  payload = build_redstone_payload(feeds)
2607
2601
  price_from, price_to = _read_prices_usd(w3, account, [from_sym, to_sym], payload)
2608
2602
  # borrow_amount such that its USD value ≈ repay USD value:
@@ -2883,9 +2877,7 @@ def cmd_execute_withdrawal(pool_name: str, index: int = None, execute: bool = Fa
2883
2877
  print("Run with --execute to broadcast (pulls the funds to the wallet).")
2884
2878
  return
2885
2879
 
2886
- feeds = degen_account_price_feeds(account)
2887
- if symbol in REDSTONE_AVAILABLE_FEEDS and symbol not in feeds:
2888
- feeds.append(symbol)
2880
+ feeds = sorted(REDSTONE_AVAILABLE_FEEDS)
2889
2881
  payload = build_redstone_payload(feeds)
2890
2882
  base_calldata = account.encode_abi("executeWithdrawalIntent", args=[asset_b32(symbol), ready])
2891
2883
  data = base_calldata + payload.hex()
@@ -3184,7 +3176,7 @@ def cmd_aero_add_liquidity(pool_key: str, amount0: float = None,
3184
3176
  return
3185
3177
 
3186
3178
  # Build RedStone payload for solvency check
3187
- feeds = degen_account_price_feeds(account)
3179
+ feeds = sorted(REDSTONE_AVAILABLE_FEEDS)
3188
3180
  payload = build_redstone_payload(feeds)
3189
3181
 
3190
3182
  # Encode the mint call: use the probed selector + ABI-encoded params
@@ -3332,7 +3324,7 @@ def cmd_aero_collect_fees(token_id: int, execute: bool = False):
3332
3324
 
3333
3325
  # Build RedStone payload (collect may be solvency-gated)
3334
3326
  try:
3335
- feeds = degen_account_price_feeds(account)
3327
+ feeds = sorted(REDSTONE_AVAILABLE_FEEDS)
3336
3328
  payload = build_redstone_payload(feeds)
3337
3329
  except Exception:
3338
3330
  payload = b""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: primecli
3
- Version: 0.7.0
3
+ Version: 0.7.2
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "primecli"
7
- version = "0.7.0"
7
+ version = "0.7.2"
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