Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tripolskypetr/wallet-manager/llms.txt
Use this file to discover all available pages before exploring further.
What is the REPL?
The Wallet Manager REPL is a readline-based interactive shell that gives you direct, programmatic access to your Binance spot wallet from a terminal prompt. It is built on Node’sreadline module (see scripts/repl.mjs) and works by calling eval() on each line you type, so any valid JavaScript expression is accepted — including expressions that use await.
Key characteristics:
- Top-level
await— every command can be async; the shell awaits the result before printing it. - Pretty-printed output — objects and arrays are serialized with
JSON.stringify(value, null, 2)before being printed; primitives (numbers, strings) are printed as-is. - Two injected globals —
walletandfsare available onglobalThiswithout any import. - Exits cleanly — type
exitto close the readline interface and terminate the process.
Starting the REPL
npm start runs the build step first, then launches scripts/repl.mjs with .env loaded via dotenv. Make sure your .env file is in the project root:
Injected Globals
wallet — the service container
The wallet global exposes two services:
| Property | Description |
|---|---|
wallet.walletPublicService | Use this one. Per-symbol serialized execution queue, argument validation, and a structured audit log entry printed to console.log after every commit. |
wallet.walletPrivateService | The raw layer underneath — no queueing, no validation, no audit log. For debugging only. |
Why prefer walletPublicService?
walletPublicService wraps every call in a per-symbol queued execution gate (from functools-kit). Concurrent calls for the same symbol are serialized, so you can never accidentally fire two mutating commands on the same symbol at the same time. It also validates argument types before touching the exchange and flushes internal caches after every commit so the next read reflects the new state.
fs — Node’s fs module
The standard fs module is injected as globalThis.fs. Use it to dump large results to disk rather than scrolling through terminal output:
Audit Log
After everycommit* call completes (successfully or not), walletPublicService prints a structured audit record to console.log:
| Field | Value |
|---|---|
symbol | The trading pair (e.g. "SOLUSDT") |
action | One of "buy", "sell", "trade", "cancel" |
amountUSDT | The USDT amount requested (0 for commitCancel) |
averagePrice | The market price snapshot taken before the order was placed |
date | JavaScript Date object — the moment the commit resolved |
status | "success" if no exception was thrown; "failed" otherwise |
Example REPL Session
The following is a real session from the README showing a price check followed by a clean exit:commitBuy prompt ({ symbol: ..., status: 'success' }) is the audit log printed automatically by walletPublicService via console.log — it is a side effect, not the return value. The second line (77.64) is the return value of commitBuy: the average fill price as a plain number.
Dumping Results to a File
When a command returns a large array (e.g.fetchPnl with a high limit), pipe the result to disk:
pnl.json in any editor or feed it to jq for offline analysis.