nirium 0.9.1__tar.gz → 0.9.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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nirium
3
- Version: 0.9.1
4
- Summary: Official Python SDK for Nirium autonomous agents on Stellar (x402 + MPP)
3
+ Version: 0.9.2
4
+ Summary: Autonomous treasury and agentic-payments infrastructure for Stellar (x402 + MPP) — Python client
5
5
  Author: Nirium Team
6
6
  Author-email: Nirium Protocol <niriumprotocol@gmail.com>
7
7
  License-Expression: Apache-2.0
@@ -9,7 +9,7 @@ Project-URL: Homepage, https://nirium.xyz
9
9
  Project-URL: Repository, https://github.com/nirium-protocol/nirium-sdk
10
10
  Project-URL: Documentation, https://nirium.xyz/docs
11
11
  Project-URL: Bug Tracker, https://github.com/nirium-protocol/nirium-sdk/issues
12
- Keywords: nirium,stellar,soroban,defi,sdk,agent,autonomous,treasury,x402,mpp,agentic-payments,usdc,cetes,etherfuse,rwa
12
+ Keywords: nirium,stellar,soroban,defi,agent,autonomous,treasury,x402,mpp,agentic-payments,usdc,cetes,etherfuse,rwa
13
13
  Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  Requires-Dist: aiohttp>=3.9.0
@@ -20,7 +20,7 @@ Dynamic: requires-python
20
20
 
21
21
  # nirium
22
22
 
23
- Official Python SDK for the **Nirium Protocol** — autonomous AI treasury infrastructure on Stellar/Soroban.
23
+ Autonomous treasury and agentic-payments infrastructure for **Nirium Protocol** on Stellar/Soroban — Python client.
24
24
 
25
25
  Nirium agents rebalance USDC ↔ CETES (tokenized Mexican T-bills via Etherfuse) 24/7 without human intervention. Built for developers who want to integrate autonomous treasury management, agentic payments (x402 + MPP), and real-time market signals into their applications.
26
26
 
@@ -1,6 +1,6 @@
1
1
  # nirium
2
2
 
3
- Official Python SDK for the **Nirium Protocol** — autonomous AI treasury infrastructure on Stellar/Soroban.
3
+ Autonomous treasury and agentic-payments infrastructure for **Nirium Protocol** on Stellar/Soroban — Python client.
4
4
 
5
5
  Nirium agents rebalance USDC ↔ CETES (tokenized Mexican T-bills via Etherfuse) 24/7 without human intervention. Built for developers who want to integrate autonomous treasury management, agentic payments (x402 + MPP), and real-time market signals into their applications.
6
6
 
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "nirium"
7
- version = "0.9.1"
8
- description = "Official Python SDK for Nirium autonomous agents on Stellar (x402 + MPP)"
7
+ version = "0.9.2"
8
+ description = "Autonomous treasury and agentic-payments infrastructure for Stellar (x402 + MPP) — Python client"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  license = "Apache-2.0"
12
12
  authors = [{name = "Nirium Protocol", email = "niriumprotocol@gmail.com"}]
13
- keywords = ["nirium", "stellar", "soroban", "defi", "sdk", "agent", "autonomous", "treasury", "x402", "mpp", "agentic-payments", "usdc", "cetes", "etherfuse", "rwa"]
13
+ keywords = ["nirium", "stellar", "soroban", "defi", "agent", "autonomous", "treasury", "x402", "mpp", "agentic-payments", "usdc", "cetes", "etherfuse", "rwa"]
14
14
  dependencies = [
15
15
  "aiohttp>=3.9.0",
16
16
  "websockets>=13.0",
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="nirium",
5
- version="0.9.1",
5
+ version="0.9.2",
6
6
  package_dir={"": "src"},
7
7
  packages=find_packages(where="src"),
8
8
  install_requires=[
@@ -11,7 +11,7 @@ setup(
11
11
  "stellar-sdk>=11.0.0,<16.0.0",
12
12
  ],
13
13
  author="Nirium Team",
14
- description="Official Python SDK for Nirium autonomous agents on Stellar (x402 + MPP)",
14
+ description="Autonomous treasury and agentic-payments infrastructure for Stellar (x402 + MPP) — Python client",
15
15
  keywords=["nirium", "stellar", "defi", "x402", "mpp", "agentic-payments", "soroban"],
16
16
  python_requires=">=3.10",
17
17
  )
@@ -2,5 +2,5 @@
2
2
 
3
3
  from .client import Agent # type: ignore
4
4
 
5
- __version__ = "0.9.1"
5
+ __version__ = "0.9.2"
6
6
  __all__ = ["Agent"]
@@ -416,6 +416,149 @@ class Agent:
416
416
  },
417
417
  )
418
418
 
419
+ # ─── Treasury (DeFindex) ───────────────────────────────────
420
+ #
421
+ # Nirium never holds these funds. It holds the RebalanceManager role of a
422
+ # DeFindex vault the client deploys and owns — every write below returns
423
+ # an UNSIGNED XDR; you decide whether and when to sign it and call
424
+ # ``submit_treasury_tx``. ``rebalance()`` never takes a destination
425
+ # address, so withdrawal is not something the role can express.
426
+
427
+ async def get_treasury_info(self) -> Dict[str, Any]:
428
+ """Treasury node metadata: role, custody model, fees, security notes."""
429
+ return await self._get("/api/treasury/info")
430
+
431
+ async def get_treasury_vault(self, vault_id: str, holder: Optional[str] = None) -> Dict[str, Any]:
432
+ """Read a vault's roles, assets and managed funds.
433
+
434
+ Pass ``holder`` to also get its balance in the vault's asset.
435
+ """
436
+ return await self._get(f"/api/treasury/vault/{vault_id}", params={"holder": holder})
437
+
438
+ async def get_treasury_vaults(self, manager: Optional[str] = None) -> Dict[str, Any]:
439
+ """List vaults Nirium has deployed or read, on the current network."""
440
+ return await self._get("/api/treasury/vaults", params={"manager": manager})
441
+
442
+ async def get_treasury_strategy_asset(self, strategy_id: str) -> Dict[str, Any]:
443
+ """Read which asset a strategy manages, as declared by the strategy itself — pairs it correctly before you deploy."""
444
+ return await self._get(f"/api/treasury/strategy/{strategy_id}")
445
+
446
+ async def deploy_treasury_vault(
447
+ self,
448
+ manager: str,
449
+ caller: str,
450
+ assets: List[Dict[str, Any]],
451
+ name: str,
452
+ symbol: str,
453
+ emergency_manager: Optional[str] = None,
454
+ fee_receiver: Optional[str] = None,
455
+ rebalance_manager: Optional[str] = None,
456
+ ) -> Dict[str, Any]:
457
+ """Build an unsigned XDR to deploy a DeFindex vault.
458
+
459
+ ``manager`` keeps control (rescue, pause, revoke); Nirium only ever
460
+ holds ``rebalance_manager``, which cannot withdraw or change roles.
461
+ ``assets`` is ``[{"address": "C...", "strategies": [{"address": "C...", "name": "..."}]}]``.
462
+ Sign the returned XDR with ``caller`` and submit via
463
+ ``submit_treasury_tx``.
464
+ """
465
+ payload: Dict[str, Any] = {
466
+ "manager": manager, "caller": caller, "assets": assets,
467
+ "name": name, "symbol": symbol,
468
+ }
469
+ for key, value in (
470
+ ("emergencyManager", emergency_manager), ("feeReceiver", fee_receiver),
471
+ ("rebalanceManager", rebalance_manager),
472
+ ):
473
+ if value is not None:
474
+ payload[key] = value
475
+ return await self._post("/api/treasury/deploy", payload)
476
+
477
+ async def deposit_to_treasury_vault(
478
+ self,
479
+ vault: str,
480
+ from_: str,
481
+ amounts: List[Any],
482
+ invest: Optional[bool] = None,
483
+ max_slippage_bps: Optional[int] = None,
484
+ ) -> Dict[str, Any]:
485
+ """Build an unsigned deposit XDR.
486
+
487
+ ``amounts`` is one amount per vault asset, in stroops, as strings —
488
+ an i128 does not survive a JSON number. Sign with ``from_`` and
489
+ submit via ``submit_treasury_tx``.
490
+ """
491
+ payload: Dict[str, Any] = {"vault": vault, "from": from_, "amounts": [str(a) for a in amounts]}
492
+ if invest is not None:
493
+ payload["invest"] = invest
494
+ if max_slippage_bps is not None:
495
+ payload["maxSlippageBps"] = max_slippage_bps
496
+ return await self._post("/api/treasury/deposit", payload)
497
+
498
+ async def withdraw_from_treasury_vault(
499
+ self,
500
+ vault: str,
501
+ from_: str,
502
+ shares: Optional[Any] = None,
503
+ max_slippage_bps: Optional[int] = None,
504
+ ) -> Dict[str, Any]:
505
+ """Build an unsigned withdraw XDR. Omit ``shares`` to withdraw everything.
506
+
507
+ Sign with ``from_`` and submit via ``submit_treasury_tx``.
508
+ """
509
+ payload: Dict[str, Any] = {"vault": vault, "from": from_}
510
+ if shares is not None:
511
+ payload["shares"] = str(shares)
512
+ if max_slippage_bps is not None:
513
+ payload["maxSlippageBps"] = max_slippage_bps
514
+ return await self._post("/api/treasury/withdraw", payload)
515
+
516
+ async def set_treasury_rebalance_manager(
517
+ self, vault: str, manager: str, rebalance_manager: str,
518
+ ) -> Dict[str, Any]:
519
+ """Build an unsigned XDR handing the RebalanceManager role to a new address.
520
+
521
+ Only the vault's current Manager can sign it — the same door that
522
+ grants Nirium the role also revokes it.
523
+ """
524
+ return await self._post("/api/treasury/set-rebalance-manager", {
525
+ "vault": vault, "manager": manager, "rebalanceManager": rebalance_manager,
526
+ })
527
+
528
+ async def build_treasury_rebalance(
529
+ self, vault: str, instructions: List[Dict[str, Any]], caller: Optional[str] = None,
530
+ ) -> Dict[str, Any]:
531
+ """Build an unsigned rebalance XDR.
532
+
533
+ ``instructions`` is
534
+ ``[{"kind": "Unwind" | "Invest", "strategy": "C...", "amount": "1000000"}]``
535
+ — the vault's own strategies only, no other instruction is
536
+ expressible. Sign with the vault's RebalanceManager and submit via
537
+ ``submit_treasury_tx``. To have Nirium sign with its own key instead,
538
+ see ``execute_treasury_rebalance``.
539
+ """
540
+ payload: Dict[str, Any] = {"vault": vault, "instructions": instructions}
541
+ if caller is not None:
542
+ payload["caller"] = caller
543
+ return await self._post("/api/treasury/rebalance", payload)
544
+
545
+ async def execute_treasury_rebalance(
546
+ self, vault: str, instructions: List[Dict[str, Any]], caller: Optional[str] = None,
547
+ ) -> Dict[str, Any]:
548
+ """Sign and submit a rebalance with Nirium's own RebalanceManager key and wait for confirmation.
549
+
550
+ Only available where that key actually lives — mainnet's
551
+ receive-only box returns 501 by design, not a broken 500.
552
+ """
553
+ payload: Dict[str, Any] = {"vault": vault, "instructions": instructions}
554
+ if caller is not None:
555
+ payload["caller"] = caller
556
+ return await self._post("/api/treasury/rebalance/execute", payload)
557
+
558
+ async def submit_treasury_tx(self, xdr: str) -> Dict[str, Any]:
559
+ """Broadcast an XDR you already signed (deploy/deposit/withdraw/rebalance/set-rebalance-manager) and wait for confirmation."""
560
+ return await self._post("/api/treasury/submit", {"xdr": xdr})
561
+
419
562
  # ─── Admin ───────────────────────────────────────────────
420
563
 
421
564
  async def configure_llm(
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nirium
3
- Version: 0.9.1
4
- Summary: Official Python SDK for Nirium autonomous agents on Stellar (x402 + MPP)
3
+ Version: 0.9.2
4
+ Summary: Autonomous treasury and agentic-payments infrastructure for Stellar (x402 + MPP) — Python client
5
5
  Author: Nirium Team
6
6
  Author-email: Nirium Protocol <niriumprotocol@gmail.com>
7
7
  License-Expression: Apache-2.0
@@ -9,7 +9,7 @@ Project-URL: Homepage, https://nirium.xyz
9
9
  Project-URL: Repository, https://github.com/nirium-protocol/nirium-sdk
10
10
  Project-URL: Documentation, https://nirium.xyz/docs
11
11
  Project-URL: Bug Tracker, https://github.com/nirium-protocol/nirium-sdk/issues
12
- Keywords: nirium,stellar,soroban,defi,sdk,agent,autonomous,treasury,x402,mpp,agentic-payments,usdc,cetes,etherfuse,rwa
12
+ Keywords: nirium,stellar,soroban,defi,agent,autonomous,treasury,x402,mpp,agentic-payments,usdc,cetes,etherfuse,rwa
13
13
  Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  Requires-Dist: aiohttp>=3.9.0
@@ -20,7 +20,7 @@ Dynamic: requires-python
20
20
 
21
21
  # nirium
22
22
 
23
- Official Python SDK for the **Nirium Protocol** — autonomous AI treasury infrastructure on Stellar/Soroban.
23
+ Autonomous treasury and agentic-payments infrastructure for **Nirium Protocol** on Stellar/Soroban — Python client.
24
24
 
25
25
  Nirium agents rebalance USDC ↔ CETES (tokenized Mexican T-bills via Etherfuse) 24/7 without human intervention. Built for developers who want to integrate autonomous treasury management, agentic payments (x402 + MPP), and real-time market signals into their applications.
26
26
 
File without changes