Wallet Manager has a deliberately minimal configuration surface. The only runtime inputs it needs are your Binance API credentials, supplied as two environment variables in aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/backtest-kit/wallet-manager/llms.txt
Use this file to discover all available pages before exploring further.
.env file at the project root. When you run npm start, dotenv loads that file before the REPL process starts, making the variables available to src/config/params.ts which exports them for use throughout the service layer. There are no configuration files, no YAML, and no flags — credentials in .env is the entire configuration model.
Environment variables
Your Binance API key. Used to authenticate every request sent to the Binance REST API via
node-binance-api. If this value is empty at startup, the first call to getBinance() throws "Binance API KEY is empty" and clears the singleshot lock so the next call retries.Your Binance API secret. Used to sign every authenticated request. If this value is empty,
getBinance() throws "Binance API SECRET is empty" under the same retry semantics as the missing key..env file setup
Create a file named .env in the wallet-manager project root and populate it with your credentials:
.env
Obtaining API credentials
Log in to Binance
Go to binance.com and sign in to your account.
Open API Management
Navigate to Account → API Management from the user menu in the top-right corner.
Create a new API key
Click Create API and choose a label. Complete any 2FA challenge Binance requires.
Set permissions
Enable only the permissions Wallet Manager needs (see the table below). Leave everything else disabled, especially withdrawals.
Restrict to your IP
Under IP access restrictions, add your server or workstation IP. A key locked to a specific IP cannot be used even if it leaks.
Required API key permissions
| Permission | Required |
|---|---|
| ✅ Enable Reading | Yes — needed for balance, price, and order queries |
| ✅ Enable Spot & Margin Trading | Yes — needed for all commit* operations |
| ❌ Enable Withdrawals | No — do not enable |
How credentials are used in the code
src/config/params.ts reads both variables from process.env and falls back to an empty string so the module always exports a string (never undefined):
getBinance() in WalletPrivateService. If either is an empty string at the time of the first API call, the factory throws immediately with a descriptive error and clears its singleshot lock — so fixing the .env file and making another call is enough to recover, without restarting the process.
recvWindow
The Binance client is initialised with recvWindow: 60000 (60 seconds). This is the window Binance uses for timestamp validation: a request whose timestamp differs from the server clock by more than recvWindow milliseconds is rejected. The generous 60-second window prevents spurious authentication failures on hosts whose system clock is slightly out of sync.
useServerTime: true is also set in the client options, which instructs node-binance-api to call useServerTime() on init and align the local request timestamps with Binance’s server clock. This happens automatically inside getBinance() before the instance is returned to any caller.Build configuration
Wallet Manager uses Rollup to compilesrc/index.ts to build/index.mjs. The npm start script runs the build step first, then launches the REPL with credentials injected via dotenv:
npm start script expands to:
npm start produces a fresh build from source before opening the REPL — edits to src/ are always reflected on the next start without a separate build step.