This guide walks you from a fresh checkout to a live REPL session where you can inspect prices, balances, and orders against your Binance spot account.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.
Prerequisites
- Node.js 18 or later (ESM + top-level
awaitsupport required) - A Binance spot account with funds you are comfortable testing with
- A Binance API key and secret with Spot Trading permission enabled
- Withdraw permission is not needed and should be left disabled
Clone and install
The package is private (
"private": true in package.json) and not
published to npm, so it must be cloned directly. All runtime dependencies —
node-binance-api, di-kit, functools-kit, and friends —
are installed by npm install.Configure your API keys
Create a The
.env file in the project root. Wallet Manager reads exactly two variables (from src/config/params.ts):.env file is loaded automatically by dotenv when you run npm start — you never need to source it or set the variables in your shell environment.Build and start the REPL
start script runs two things in sequence (from package.json):package.json
npm run build— Rollup compilessrc/index.tstobuild/index.mjs(ESM bundle).dotenv -e .env -- node ./scripts/repl.mjs— loads.envinto the process environment, then starts the REPL.
repl => prompt:await is supported at the top level. Objects are pretty-printed as JSON. Type exit to quit.First commands in the REPL
All read-only commands go throughwallet.walletPublicService. Start here — nothing below modifies your account.
Fetch current price
number. Results are cached for 30 seconds per symbol.
Fetch USDT balance
number.
Fetch coin balance
{ quantity, usdt } object for the coin associated with the symbol. quantity includes any amounts currently locked in open orders (onOrder).
Fetch recent orders
FILLED, CANCELED, or NEW) with side, price, quantities, and timestamps.
Fetch daily PnL
Dump results to a file
Thefs global (Node’s built-in fs module) is injected by scripts/repl.mjs so you can save any result without leaving the REPL:
REPL globals
Two globals are available in every REPL session:| Global | Description |
|---|---|
wallet | The service container — holds walletPublicService and walletPrivateService. |
fs | Node’s built-in fs module — useful for writing results to disk. |
wallet is also assigned to globalThis by src/index.ts, so it is accessible from any imported module loaded into the same process.
Using Wallet Manager as a library
After building (npm run build), import from build/index.mjs in your own scripts:
Always prefer
wallet.walletPublicService over wallet.walletPrivateService
in application code. The public service serializes calls per symbol (no
concurrent orders on the same symbol), validates arguments, and writes an
audit record to the console after every commit:
{ symbol, action, amountUSDT, averagePrice, date, status }.Next steps
- REPL Guide — Full reference for every mutating command:
commitBuy,commitSell,commitTrade, andcommitCancel. - Broker Adapter — See how the commit flows map to a production backtest-kit broker adapter, including idempotent reconcile by
clientOrderIdand terminal rejection on the fifth attempt. - API Reference — Complete TypeScript signatures for both services and all data types.