Skip to main content

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.

Wallet Manager is a DI-wired TypeScript library that wraps node-binance-api with production-correct order management logic. It ships an interactive REPL so you can drive your Binance spot account by hand — buy, sell, flatten a symbol, inspect balances and PnL — and serves as the canonical reference implementation for the exchange side of a backtest-kit broker adapter.
Live keys, real money. Every commit* call places real orders on Binance spot. There is no dry-run mode.

Introduction

Understand what Wallet Manager does, why it exists, and when to use it.

Quickstart

Configure your API keys, build the bundle, and run your first REPL command in minutes.

REPL Guide

Learn how to use the interactive REPL to inspect and trade your Binance spot wallet.

Broker Adapter

See the three rules that turn these flows into a production backtest-kit broker adapter.

Order Management

Understand the cancel → verify → sell sequence that prevents balance lock errors.

API Reference

Explore every method on WalletPublicService with full parameter and return type docs.

How it works

1

Configure your Binance API keys

Create a .env file in the project directory with CC_BINANCE_API_KEY and CC_BINANCE_API_SECRET.
2

Build and start the REPL

Run npm start — it builds the ESM bundle with Rollup, loads .env via dotenv, and drops you into the interactive prompt.
3

Drive the exchange by hand

Use wallet.walletPublicService.* methods in the REPL to fetch prices, inspect orders, buy and sell — all with structured audit logging after every commit.
4

Build a broker adapter

Copy the reference SpotBroker implementation from the Broker Adapter section and wire it into your backtest-kit engine.

Key design principles

Cancel before sell

Every resting order locks its quantity. Wallet Manager always cancels pending orders and verifies a clean book before selling — preventing insufficient-balance errors.

Poll → cancel → market fallback

Limit orders are polled for up to 100 seconds. On timeout, the order is cancelled and the remainder is filled with a market order — entries never stay resting.

Per-symbol serialized queue

WalletPublicService serializes all operations per symbol using a queued executor, preventing race conditions from concurrent calls.

clientOrderId reconciliation

On retry, the adapter reconciles by clientOrderId (= signalId) before posting a new order — a lost-response fill resolves to “already bought”, not a duplicate entry.

Build docs developers (and LLMs) love