Tools
Diem Balance
Portable OpenClaw /diem balance plugin
README
# ๐ช Diem Balance Plugin
> **Zero-token Venice AI balance checks โ right from your OpenClaw agent.**
No LLM inference. No token burn. Just a clean `/diem` command that pings the Venice API and reports your remaining Diem balance instantly.
```
/diem
```
```
๐ช Venice Diem Balance: `3.5012 Diem`
```
---
## โจ Features
- โก **Zero-token** โ makes a minimal 1-token inference request just to read balance headers
- ๐ **Startup-registered** โ available immediately when OpenClaw boots
- ๐ฆ **Portable** โ single folder, no secrets bundled, works on any machine with OpenClaw
- ๐งช **Tested** โ 15 offline baseline tests, no credentials required to run them
- ๐ **Drop-in install** โ one `bash` command and a gateway restart
---
## ๐ฆ Install
```bash
bash scripts/install.sh
```
Then restart OpenClaw Gateway:
```bash
openclaw gateway restart
```
Run it:
```
/diem
```
> **Default install path:** `~/.openclaw/extensions/diem`
> Override with `OPENCLAW_EXT_DIR=/your/path bash scripts/install.sh`
---
## ๐ Auth
No secrets are included in this repo. The plugin reads your Venice AI API key from the OpenClaw auth profile already on your machine:
```
~/.openclaw/agents/*/agent/auth-profiles.json
```
It expects a `venice:default` profile with a `key` field โ the same one OpenClaw uses for Venice inference. If you're already running Venice models, this just works.
---
## ๐๏ธ Structure
```
diem-balance-plugin/
โโโ extensions/
โ โโโ diem/
โ โโโ openclaw.plugin.json # Plugin manifest
โ โโโ index.ts # Command registration + output formatting
โ โโโ diem.py # Python script โ hits Venice API for balance headers
โ โโโ test.mjs # Offline baseline test suite
โโโ scripts/
โ โโโ install.sh # Copies plugin files into OpenClaw extensions dir
โโโ INSTRUCTIONS.md # Human-readable install guide
โโโ package.json # npm test entry point
```
---
## ๐งช Tests
Offline โ no Venice credentials needed:
```bash
npm test
```
```
โธ Manifest PASS ร4
โธ Entry point PASS ร1
โธ Registration PASS ร4
โธ formatBalance PASS ร5
โธ diem.py syntax PASS ร1
โโโ 15 passed, 0 failed โโโ
```
---
## ๐ ๏ธ How It Works
1. `/diem` is registered as a zero-arg OpenClaw command on startup
2. `index.ts` shells out to `diem.py` via `execSync`
3. `diem.py` sends a minimal 1-token request to `https://api.venice.ai` and reads the response headers
4. The `x-venice-balance-diem` header value is parsed and formatted
5. Result is returned to the chat surface
---
## ๐ Links
- [Venice AI](https://venice.ai) โ the inference provider
- [OpenClaw](https://openclaw.ai) โ the agent platform this plugin targets
- [clawSean on GitHub](https://github.com/clawSean) โ org this plugin lives under
tools
Comments
Sign in to leave a comment