dsh-wallet-badge: Display Balance in the DeepSeek Harness Sidebar

Preface

DeepSeek Harness (DSH) currently has no way to display the current account balance at the bottom of its sidebar. Developers must open the platform’s web page to view their recharge balance and bonus balance, or manually refresh the page. This adds extra steps and makes it easy to miss balance changes. dsh-wallet-badge adds a balance display line at the bottom of the DSH sidebar, so you can see your balance status without leaving the DSH interface.

What Is This Plugin

dsh-wallet-badge is a plugin that adds a DeepSeek API balance line to the bottom of the DeepSeek Harness sidebar. It is maintained by user Mengnan578 and falls under the network tool category. It reads the recharge wallet and bonus wallet of the currently logged-in DeepSeek account, checks the balance once per minute, and updates the UI whenever the balance changes.

Core Features

Balance Display

The plugin inserts a “Balance / 余额” line before the Settings item at the bottom of the DSH sidebar. This line displays the combined total of the recharge balance and the bonus balance:

  • When the sidebar is expanded, the amount is shown, e.g., “余额 ¥12.34”.
  • When the sidebar is collapsed, only the wallet icon is displayed; the amount appears in a hover tooltip and in the detail card.

Balance Color Indicators

Color coding is applied based on the amount:

  • Amber when the balance is below ¥5.
  • Red when the balance is ¥0 or below ¥1.

Detail Card

Clicking the balance line opens a detail card that includes:

  • Recharge balance.
  • Bonus balance (shown only when non-zero).
  • Last updated time and the auto-refresh interval (once per minute).
  • Action buttons: Refresh, Top Up, and Usage Details.

Auto-Refresh and Manual Refresh

The plugin checks the balance via polling:

  • By default, it checks once per minute.
  • An immediate refresh is triggered in the following situations: the window regains focus, the page becomes visible again, a new Host connection is established, or the DSH account logs in or logs out.
  • Right-clicking the balance line manually triggers a refresh.

Number Roll Animation

When the balance changes, the numbers roll from the old value to the new one with an animation lasting approximately 0.6 seconds. If the user’s system has prefers-reduced-motion enabled, the final value is displayed directly without animation.

Signed-Out State

If no DeepSeek account is currently logged in, the balance line displays “Signed out / 未登录”, and the detail card prompts the user to log in via Settings → Account. After logging in, the plugin automatically populates the balance.

Data & Privacy

The plugin reads the balance from the DSH Host’s account.getBalance API, which uses the same authentication method as the DSH Settings → Account page. The DSH Host holds the credentials and sends a /api/v0/users/get_user_summary request to the configured DeepSeek platform. The plugin itself never sees, reads, or stores any Token. It does not require an API Key, nor does it add Host routes, model requests, session events, or Token usage tracking.

Installation & Activation

The plugin is installed as an npm package. Run the following in your terminal:

# Add this package as a DSH profile bundle
npm install dsh-wallet-badge

After installation, add dsh-wallet-badge to your configured profile bundles in DSH, or select the local path or package name via DSH’s “Plugins → Add plugin”. The package contains one Host half (no-op) and one Client contribution.

Usage

Once installed, as long as DeepSeek Harness is running and a DeepSeek account is logged in, the balance line will automatically appear at the bottom of the sidebar. No additional configuration fields are required. To view the balance, simply expand or collapse the sidebar—the detail card will show the recharge balance, bonus balance, and last updated time. When you need to top up, click “Top Up” to navigate to the payment page.

Use Cases & Notes

This plugin is well-suited for scenarios where you frequently need to check your API balance while developing with or using DSH. It communicates with the DeepSeek platform through the DSH process’s permissions, so you should review the source code and license before installing. The plugin displays the balance in read-only mode; detailed top-up and usage breakdowns remain on the platform’s web page, and the plugin provides link entries to them via the detail card.

In Closing

dsh-wallet-badge lets DeepSeek Harness users check their balance without leaving the interface, through polling and on-demand refreshes. It provides intuitive color indicators and a number roll animation when the balance changes. The maintainer and source code are available on GitHub: https://github.com/Mengnan578/dsh-wallet-badge

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye