nirium 0.9.2__tar.gz → 0.10.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.
- {nirium-0.9.2 → nirium-0.10.0}/PKG-INFO +32 -2
- {nirium-0.9.2 → nirium-0.10.0}/README.md +31 -1
- {nirium-0.9.2 → nirium-0.10.0}/pyproject.toml +1 -1
- {nirium-0.9.2 → nirium-0.10.0}/setup.py +1 -1
- {nirium-0.9.2 → nirium-0.10.0}/src/nirium/__init__.py +1 -1
- {nirium-0.9.2 → nirium-0.10.0}/src/nirium/client.py +23 -0
- {nirium-0.9.2 → nirium-0.10.0}/src/nirium.egg-info/PKG-INFO +32 -2
- {nirium-0.9.2 → nirium-0.10.0}/setup.cfg +0 -0
- {nirium-0.9.2 → nirium-0.10.0}/src/nirium.egg-info/SOURCES.txt +0 -0
- {nirium-0.9.2 → nirium-0.10.0}/src/nirium.egg-info/dependency_links.txt +0 -0
- {nirium-0.9.2 → nirium-0.10.0}/src/nirium.egg-info/requires.txt +0 -0
- {nirium-0.9.2 → nirium-0.10.0}/src/nirium.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nirium
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
4
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>
|
|
@@ -50,7 +50,9 @@ async def main():
|
|
|
50
50
|
market = await agent.get_market()
|
|
51
51
|
print(f"XLM Price: ${market['xlmPrice']:.4f}")
|
|
52
52
|
|
|
53
|
-
#
|
|
53
|
+
# Trigger a demo strategy on Nirium's own shared testnet vault — a real,
|
|
54
|
+
# working transaction, not a simulation, but it moves Nirium's testnet
|
|
55
|
+
# funds, not yours. To rebalance YOUR OWN vault, see Treasury Rebalance below.
|
|
54
56
|
result = await agent.execute("blend-yield", "USDC", {"amount": 5000})
|
|
55
57
|
print(f"Success: {result['success']} | TX: {result.get('txHash')}")
|
|
56
58
|
|
|
@@ -130,6 +132,33 @@ Licensed for **independent service payments only** — contractors, freelancers,
|
|
|
130
132
|
|
|
131
133
|
Mainnet is invite-only during early access and additionally requires `client_info`.
|
|
132
134
|
|
|
135
|
+
## Treasury Rebalance
|
|
136
|
+
|
|
137
|
+
Two ways to rebalance a DeFindex vault between idle cash and an invested strategy. Neither is a swap — the contract's `rebalance()` exposes exactly two instructions, `Unwind` and `Invest`, and neither accepts a destination address, so withdrawing anywhere but back into the vault itself is not expressible.
|
|
138
|
+
|
|
139
|
+
### Propose — you review and sign, available to everyone today
|
|
140
|
+
|
|
141
|
+
The agent decides what it would do, using the same decision logic as the autonomous signer below, but it never signs. Public, no allowlist, no invite required — works for any vault where you're already the on-chain rebalance manager.
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
proposal = await agent.propose_treasury_rebalance(
|
|
145
|
+
vault="CABC...",
|
|
146
|
+
caller="GABC...", # must already be this vault's rebalanceManager on-chain
|
|
147
|
+
enter_at=2.5, # your own mandate — Nirium never supplies a default here
|
|
148
|
+
exit_at=2.0,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
if proposal["instructions"]:
|
|
152
|
+
signed_xdr = sign_with_your_wallet(proposal["xdr"])
|
|
153
|
+
await agent.submit_treasury_tx(signed_xdr)
|
|
154
|
+
else:
|
|
155
|
+
print("Nothing to propose:", proposal["reason"])
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Autonomous — Nirium signs, invite-only during legal review
|
|
159
|
+
|
|
160
|
+
`execute_treasury_rebalance()` has Nirium sign and submit with its own RebalanceManager key — full autonomy, no per-cycle approval. **This is invite-only while a specific legal question stays open**: whether executing on a client's behalf without taking custody still counts as regulated facilitation under Mexican law. It only runs against vaults explicitly allowlisted server-side; calling it against any other vault returns 403, and Nirium's mainnet infrastructure returns 501 for it entirely, since that box holds no signing key by design. Ask if you want autonomous execution today — otherwise, `propose_treasury_rebalance()` above gives you the same decision-making with you as the one who signs.
|
|
161
|
+
|
|
133
162
|
## Audit Trail
|
|
134
163
|
|
|
135
164
|
Anchor evidence to IPFS and get back a CID — an integrity seal, not notarization.
|
|
@@ -159,6 +188,7 @@ Anchor a **hash** rather than the data itself: IPFS content cannot be deleted, s
|
|
|
159
188
|
| Revenue | `get_revenue()`, `get_info()` |
|
|
160
189
|
| Nodes | `get_nodes()` |
|
|
161
190
|
| Payouts | `create_payout_run()`, `submit_payout()`, `onboard_payout_recipient()`, `submit_payout_onboard()`, `get_payout_runs()`, `get_payout_terms()`, `get_payout_info()` |
|
|
191
|
+
| Treasury | `get_treasury_info()`, `get_treasury_vault()`, `get_treasury_vaults()`, `get_treasury_strategy_asset()`, `deploy_treasury_vault()`, `deposit_to_treasury_vault()`, `withdraw_from_treasury_vault()`, `set_treasury_rebalance_manager()`, `build_treasury_rebalance()`, `propose_treasury_rebalance()`, `execute_treasury_rebalance()`, `submit_treasury_tx()` |
|
|
162
192
|
| Audit Trail | `anchor_audit_record()`, `get_audit_info()` |
|
|
163
193
|
| Reporting | `get_reporting_summary()`, `get_reporting_export()` |
|
|
164
194
|
| Admin | `configure_llm()` |
|
|
@@ -30,7 +30,9 @@ async def main():
|
|
|
30
30
|
market = await agent.get_market()
|
|
31
31
|
print(f"XLM Price: ${market['xlmPrice']:.4f}")
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# Trigger a demo strategy on Nirium's own shared testnet vault — a real,
|
|
34
|
+
# working transaction, not a simulation, but it moves Nirium's testnet
|
|
35
|
+
# funds, not yours. To rebalance YOUR OWN vault, see Treasury Rebalance below.
|
|
34
36
|
result = await agent.execute("blend-yield", "USDC", {"amount": 5000})
|
|
35
37
|
print(f"Success: {result['success']} | TX: {result.get('txHash')}")
|
|
36
38
|
|
|
@@ -110,6 +112,33 @@ Licensed for **independent service payments only** — contractors, freelancers,
|
|
|
110
112
|
|
|
111
113
|
Mainnet is invite-only during early access and additionally requires `client_info`.
|
|
112
114
|
|
|
115
|
+
## Treasury Rebalance
|
|
116
|
+
|
|
117
|
+
Two ways to rebalance a DeFindex vault between idle cash and an invested strategy. Neither is a swap — the contract's `rebalance()` exposes exactly two instructions, `Unwind` and `Invest`, and neither accepts a destination address, so withdrawing anywhere but back into the vault itself is not expressible.
|
|
118
|
+
|
|
119
|
+
### Propose — you review and sign, available to everyone today
|
|
120
|
+
|
|
121
|
+
The agent decides what it would do, using the same decision logic as the autonomous signer below, but it never signs. Public, no allowlist, no invite required — works for any vault where you're already the on-chain rebalance manager.
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
proposal = await agent.propose_treasury_rebalance(
|
|
125
|
+
vault="CABC...",
|
|
126
|
+
caller="GABC...", # must already be this vault's rebalanceManager on-chain
|
|
127
|
+
enter_at=2.5, # your own mandate — Nirium never supplies a default here
|
|
128
|
+
exit_at=2.0,
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
if proposal["instructions"]:
|
|
132
|
+
signed_xdr = sign_with_your_wallet(proposal["xdr"])
|
|
133
|
+
await agent.submit_treasury_tx(signed_xdr)
|
|
134
|
+
else:
|
|
135
|
+
print("Nothing to propose:", proposal["reason"])
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Autonomous — Nirium signs, invite-only during legal review
|
|
139
|
+
|
|
140
|
+
`execute_treasury_rebalance()` has Nirium sign and submit with its own RebalanceManager key — full autonomy, no per-cycle approval. **This is invite-only while a specific legal question stays open**: whether executing on a client's behalf without taking custody still counts as regulated facilitation under Mexican law. It only runs against vaults explicitly allowlisted server-side; calling it against any other vault returns 403, and Nirium's mainnet infrastructure returns 501 for it entirely, since that box holds no signing key by design. Ask if you want autonomous execution today — otherwise, `propose_treasury_rebalance()` above gives you the same decision-making with you as the one who signs.
|
|
141
|
+
|
|
113
142
|
## Audit Trail
|
|
114
143
|
|
|
115
144
|
Anchor evidence to IPFS and get back a CID — an integrity seal, not notarization.
|
|
@@ -139,6 +168,7 @@ Anchor a **hash** rather than the data itself: IPFS content cannot be deleted, s
|
|
|
139
168
|
| Revenue | `get_revenue()`, `get_info()` |
|
|
140
169
|
| Nodes | `get_nodes()` |
|
|
141
170
|
| Payouts | `create_payout_run()`, `submit_payout()`, `onboard_payout_recipient()`, `submit_payout_onboard()`, `get_payout_runs()`, `get_payout_terms()`, `get_payout_info()` |
|
|
171
|
+
| Treasury | `get_treasury_info()`, `get_treasury_vault()`, `get_treasury_vaults()`, `get_treasury_strategy_asset()`, `deploy_treasury_vault()`, `deposit_to_treasury_vault()`, `withdraw_from_treasury_vault()`, `set_treasury_rebalance_manager()`, `build_treasury_rebalance()`, `propose_treasury_rebalance()`, `execute_treasury_rebalance()`, `submit_treasury_tx()` |
|
|
142
172
|
| Audit Trail | `anchor_audit_record()`, `get_audit_info()` |
|
|
143
173
|
| Reporting | `get_reporting_summary()`, `get_reporting_export()` |
|
|
144
174
|
| Admin | `configure_llm()` |
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nirium"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.10.0"
|
|
8
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"
|
|
@@ -542,6 +542,29 @@ class Agent:
|
|
|
542
542
|
payload["caller"] = caller
|
|
543
543
|
return await self._post("/api/treasury/rebalance", payload)
|
|
544
544
|
|
|
545
|
+
async def propose_treasury_rebalance(
|
|
546
|
+
self, vault: str, caller: str, enter_at: float, exit_at: float,
|
|
547
|
+
min_idle: Optional[Any] = None,
|
|
548
|
+
) -> Dict[str, Any]:
|
|
549
|
+
"""Ask the agent what it would propose for this vault — the same decision
|
|
550
|
+
logic the autonomous signer uses (rate vs. your own ``enter_at``/``exit_at``),
|
|
551
|
+
but this never signs. Returns an unsigned XDR for you to review and sign
|
|
552
|
+
yourself, or an empty ``instructions`` list with a ``reason`` if there's
|
|
553
|
+
nothing to do right now. Public: no allowlist, no invite — works for any
|
|
554
|
+
vault where ``caller`` is already the on-chain rebalanceManager. Unlike
|
|
555
|
+
``execute_treasury_rebalance``, Nirium never executes on your behalf here,
|
|
556
|
+
so this doesn't wait on the same legal review the fully autonomous path does.
|
|
557
|
+
|
|
558
|
+
``enter_at``/``exit_at`` are your mandate, not a Nirium default. ``min_idle``
|
|
559
|
+
is stroops, as a string or number — omit for no minimum (0).
|
|
560
|
+
"""
|
|
561
|
+
payload: Dict[str, Any] = {
|
|
562
|
+
"vault": vault, "caller": caller, "enterAt": enter_at, "exitAt": exit_at,
|
|
563
|
+
}
|
|
564
|
+
if min_idle is not None:
|
|
565
|
+
payload["minIdle"] = str(min_idle)
|
|
566
|
+
return await self._post("/api/treasury/rebalance/propose", payload)
|
|
567
|
+
|
|
545
568
|
async def execute_treasury_rebalance(
|
|
546
569
|
self, vault: str, instructions: List[Dict[str, Any]], caller: Optional[str] = None,
|
|
547
570
|
) -> Dict[str, Any]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nirium
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
4
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>
|
|
@@ -50,7 +50,9 @@ async def main():
|
|
|
50
50
|
market = await agent.get_market()
|
|
51
51
|
print(f"XLM Price: ${market['xlmPrice']:.4f}")
|
|
52
52
|
|
|
53
|
-
#
|
|
53
|
+
# Trigger a demo strategy on Nirium's own shared testnet vault — a real,
|
|
54
|
+
# working transaction, not a simulation, but it moves Nirium's testnet
|
|
55
|
+
# funds, not yours. To rebalance YOUR OWN vault, see Treasury Rebalance below.
|
|
54
56
|
result = await agent.execute("blend-yield", "USDC", {"amount": 5000})
|
|
55
57
|
print(f"Success: {result['success']} | TX: {result.get('txHash')}")
|
|
56
58
|
|
|
@@ -130,6 +132,33 @@ Licensed for **independent service payments only** — contractors, freelancers,
|
|
|
130
132
|
|
|
131
133
|
Mainnet is invite-only during early access and additionally requires `client_info`.
|
|
132
134
|
|
|
135
|
+
## Treasury Rebalance
|
|
136
|
+
|
|
137
|
+
Two ways to rebalance a DeFindex vault between idle cash and an invested strategy. Neither is a swap — the contract's `rebalance()` exposes exactly two instructions, `Unwind` and `Invest`, and neither accepts a destination address, so withdrawing anywhere but back into the vault itself is not expressible.
|
|
138
|
+
|
|
139
|
+
### Propose — you review and sign, available to everyone today
|
|
140
|
+
|
|
141
|
+
The agent decides what it would do, using the same decision logic as the autonomous signer below, but it never signs. Public, no allowlist, no invite required — works for any vault where you're already the on-chain rebalance manager.
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
proposal = await agent.propose_treasury_rebalance(
|
|
145
|
+
vault="CABC...",
|
|
146
|
+
caller="GABC...", # must already be this vault's rebalanceManager on-chain
|
|
147
|
+
enter_at=2.5, # your own mandate — Nirium never supplies a default here
|
|
148
|
+
exit_at=2.0,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
if proposal["instructions"]:
|
|
152
|
+
signed_xdr = sign_with_your_wallet(proposal["xdr"])
|
|
153
|
+
await agent.submit_treasury_tx(signed_xdr)
|
|
154
|
+
else:
|
|
155
|
+
print("Nothing to propose:", proposal["reason"])
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Autonomous — Nirium signs, invite-only during legal review
|
|
159
|
+
|
|
160
|
+
`execute_treasury_rebalance()` has Nirium sign and submit with its own RebalanceManager key — full autonomy, no per-cycle approval. **This is invite-only while a specific legal question stays open**: whether executing on a client's behalf without taking custody still counts as regulated facilitation under Mexican law. It only runs against vaults explicitly allowlisted server-side; calling it against any other vault returns 403, and Nirium's mainnet infrastructure returns 501 for it entirely, since that box holds no signing key by design. Ask if you want autonomous execution today — otherwise, `propose_treasury_rebalance()` above gives you the same decision-making with you as the one who signs.
|
|
161
|
+
|
|
133
162
|
## Audit Trail
|
|
134
163
|
|
|
135
164
|
Anchor evidence to IPFS and get back a CID — an integrity seal, not notarization.
|
|
@@ -159,6 +188,7 @@ Anchor a **hash** rather than the data itself: IPFS content cannot be deleted, s
|
|
|
159
188
|
| Revenue | `get_revenue()`, `get_info()` |
|
|
160
189
|
| Nodes | `get_nodes()` |
|
|
161
190
|
| Payouts | `create_payout_run()`, `submit_payout()`, `onboard_payout_recipient()`, `submit_payout_onboard()`, `get_payout_runs()`, `get_payout_terms()`, `get_payout_info()` |
|
|
191
|
+
| Treasury | `get_treasury_info()`, `get_treasury_vault()`, `get_treasury_vaults()`, `get_treasury_strategy_asset()`, `deploy_treasury_vault()`, `deposit_to_treasury_vault()`, `withdraw_from_treasury_vault()`, `set_treasury_rebalance_manager()`, `build_treasury_rebalance()`, `propose_treasury_rebalance()`, `execute_treasury_rebalance()`, `submit_treasury_tx()` |
|
|
162
192
|
| Audit Trail | `anchor_audit_record()`, `get_audit_info()` |
|
|
163
193
|
| Reporting | `get_reporting_summary()`, `get_reporting_export()` |
|
|
164
194
|
| Admin | `configure_llm()` |
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|