moneyos 0.3.3 → 0.4.0

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.
package/README.md CHANGED
@@ -1,17 +1,20 @@
1
1
  # MoneyOS
2
2
 
3
3
  MoneyOS is an open source programmable money SDK and CLI for developers and AI
4
- agents. The repo includes balance, send, swap, runtime-composition, wallet,
5
- and executor code, with the project currently centered on Arbitrum.
4
+ agents. The root package covers runtime composition, balance/send flows,
5
+ wallet/session management, and executor code. Swap now lives as a separate
6
+ tool package, with the project currently centered on Arbitrum.
6
7
 
7
8
  The project is still early. Package boundaries and some APIs are still settling,
8
9
  but the repo is structured so each major surface can evolve independently.
9
10
 
10
11
  ## What lives in this repo
11
12
 
12
- - `moneyos`: the root SDK + CLI package
13
+ - `moneyos`: the root SDK + CLI package for runtime, wallet, balance, and send
13
14
  - `@moneyos/core`: runtime interfaces, shared types, chain/token registries
14
- - `@moneyos/tool-swap`: swap execution tool and provider surface
15
+ - `@moneyos/swap`: canonical swap package and Odos provider, published on npm
16
+
17
+ Current package-boundary rules live in [`docs/architecture.md`](docs/architecture.md).
15
18
 
16
19
  ## CLI
17
20
 
@@ -22,13 +25,13 @@ moneyos init [--key 0x...] [--force] [--chain 42161] [--rpc https://...]
22
25
  moneyos auth unlock
23
26
  moneyos auth lock
24
27
  moneyos auth status
28
+ moneyos auth change-password
25
29
  moneyos backup export [--out ./wallet-backup.json] [--force]
26
30
  moneyos backup restore <path> [--force]
27
31
  moneyos backup status
28
32
  moneyos keystore status
29
33
  moneyos balance <token> [--address 0x...]
30
34
  moneyos send <amount> <token> <to>
31
- moneyos swap <amount> <tokenIn> <tokenOut>
32
35
  ```
33
36
 
34
37
  For the full command surface and flag details, run `moneyos --help`.
@@ -63,12 +66,50 @@ The runtime seam is intentionally small. `createMoneyOS` can also take injected
63
66
  `execute`, `read`, and `assets` implementations, which is how external packages
64
67
  plug in.
65
68
 
66
- ## Published npm package
69
+ Swap is no longer built into the root SDK or CLI. The canonical implementation
70
+ lives in `@moneyos/swap`, which executes against `moneyos.runtime`.
71
+
72
+ Install it alongside the root package:
67
73
 
68
- `moneyos` is published on npm. `npm install moneyos` and `npx moneyos` give
69
- you the latest tagged release, not unreleased commits on `main`. If you want
70
- work that has not shipped in a tagged release yet, clone the repo and build
71
- from source.
74
+ ```bash
75
+ npm install moneyos @moneyos/swap
76
+ ```
77
+
78
+ Then call it against the root runtime seam:
79
+
80
+ ```ts
81
+ import { createMoneyOS } from "moneyos";
82
+ import { executeSwap, OdosProvider } from "@moneyos/swap";
83
+
84
+ const moneyos = createMoneyOS({
85
+ chainId: 42161,
86
+ privateKey: process.env.MONEYOS_PRIVATE_KEY as `0x${string}`,
87
+ });
88
+
89
+ const result = await executeSwap(
90
+ {
91
+ tokenIn: "USDC",
92
+ tokenOut: "RYZE",
93
+ amount: "1",
94
+ provider: new OdosProvider(),
95
+ chainId: 42161,
96
+ },
97
+ moneyos.runtime,
98
+ );
99
+
100
+ console.log(result.hash);
101
+ ```
102
+
103
+ ## Published npm packages
104
+
105
+ Published packages:
106
+
107
+ - `moneyos`
108
+ - `@moneyos/core`
109
+ - `@moneyos/swap`
110
+
111
+ `moneyos@0.4.0` no longer bundles swap into the root SDK or CLI. If you want
112
+ swap, install `@moneyos/swap` alongside `moneyos`.
72
113
 
73
114
  ## Current wallet model
74
115
 
@@ -78,6 +119,7 @@ What is landed in code today:
78
119
  - `~/.moneyos/config.json` now stores only non-secret settings such as chain and RPC configuration
79
120
  - `MONEYOS_PRIVATE_KEY` remains an explicit override for ephemeral CI or agent runs
80
121
  - `moneyos auth unlock` opens a short-lived local session for write commands
122
+ - `moneyos auth change-password` rotates the local wallet password and locks the current session
81
123
  - `moneyos backup export|restore|status` manages encrypted wallet backups
82
124
  - Normal wallet commands resolve their write path through one shared session-aware flow
83
125
  - Local EOA signers use viem's nonce manager, so back-to-back live transactions
@@ -119,6 +161,19 @@ If you have a legacy `~/.moneyos/config.json` with a plaintext `privateKey`
119
161
  field from a pre-encrypted-wallet version of the CLI, `moneyos init` with no
120
162
  flags will detect and import that key automatically.
121
163
 
164
+ ## Changing the wallet password
165
+
166
+ Use:
167
+
168
+ ```bash
169
+ moneyos auth change-password
170
+ ```
171
+
172
+ This re-encrypts the active local wallet file with a new password and locks the
173
+ current local session. Existing backup files and previously exported backups
174
+ remain snapshots encrypted with the old password. If you want a backup under
175
+ the new password, run `moneyos backup export` after the password change.
176
+
122
177
  ## Threat model
123
178
 
124
179
  What this wallet model is meant to protect against:
@@ -137,7 +192,7 @@ What it does not protect against:
137
192
 
138
193
  ## Known operational limitations
139
194
 
140
- - If a session-backed `send` or `swap` returns a timeout or disconnect error,
195
+ - If a session-backed write command returns a timeout or disconnect error,
141
196
  do not assume nothing was broadcast. Verify on-chain before retrying.
142
197
  - PR #12 fixed the common 750ms false-timeout path, but client-disconnect
143
198
  detection and request idempotency are still follow-up work.
@@ -184,7 +239,7 @@ What still needs more hands-on validation:
184
239
 
185
240
  - live session-backed ETH send
186
241
  - live session-backed ERC-20 send
187
- - live session-backed swap
242
+ - live execution of external tools against the session-backed runtime seam
188
243
  - more live usage of the encrypted-wallet/auth/backup flow in a real terminal
189
244
 
190
245
  ## Development
@@ -192,16 +247,18 @@ What still needs more hands-on validation:
192
247
  ```bash
193
248
  npm install
194
249
  npm run build:core
195
- npm run build:tool-swap
250
+ npm run build:swap
196
251
  npm run typecheck
197
252
  npm test
198
253
  npm run lint
199
254
  npm run build
200
255
  ```
201
256
 
202
- The repo currently uses npm workspaces. Before any npm release, verify the
203
- packed tarballs with `npm pack --dry-run` and confirm publish-time dependency
204
- resolution for the extracted workspace packages.
257
+ The repo currently uses npm workspaces. Test runs build `@moneyos/core` and
258
+ `@moneyos/swap` first so the swap tests exercise the real workspace
259
+ package boundary instead of source-relative imports. Before any npm release,
260
+ verify the packed tarballs with `npm pack --dry-run` and confirm publish-time
261
+ dependency resolution for the extracted workspace packages.
205
262
 
206
263
  ## License
207
264