@moneytools-dev/openclaw-plugin 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/openclaw.plugin.json +3 -3
- package/package.json +1 -1
- package/src/checks.js +1 -1
- package/src/guard.js +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
| Before any x402 payment | [Pay precheck](https://api.moneytools.dev/v1/precheck): validates the seller's 402 terms (network, amount, asset, payTo) and screens payTo against the OFAC SDN list | free daily tier, then 0.005 USDC |
|
|
8
8
|
| Before any token approval (ERC-20 `approve` / `increaseAllowance`, `setApprovalForAll`, Permit2 `approve`, Permit/Permit2 signatures) | [Wallet Risk Card](https://tools.moneytools.dev/v1/wallet-risk) on the spender: 0-100 risk score, grade A-F, OFAC SDN match, address checks, open approvals | 0.02 USDC |
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Paid checks are **opt-in** (`autoPay: true`); by default the plugin uses only the free tier and asks you when a check would need payment. When enabled, checks are paid in USDC on Base from the agent's own wallet. There is no MoneyTools account or API key. MoneyTools does not settle a payment when a check fails, so failed checks are not charged.
|
|
11
11
|
|
|
12
12
|
## Install (one line)
|
|
13
13
|
|
|
@@ -15,9 +15,15 @@ Checks are paid in USDC on Base from the agent's own wallet. There is no MoneyTo
|
|
|
15
15
|
openclaw plugins install @moneytools-dev/openclaw-plugin && openclaw plugins enable moneytools-guard
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
+
To let it pay for checks automatically (opt-in, capped at 0.25 USDC/day by default):
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
openclaw config set plugins.entries.moneytools-guard.config.autoPay true
|
|
22
|
+
```
|
|
23
|
+
|
|
18
24
|
From npm instead of ClawHub: `openclaw plugins install npm:@moneytools-dev/openclaw-plugin`.
|
|
19
25
|
|
|
20
|
-
The plugin is off until you enable it
|
|
26
|
+
The plugin is off until you enable it, and it spends nothing until you set `autoPay: true`.
|
|
21
27
|
|
|
22
28
|
## What it spends, and from which wallet
|
|
23
29
|
|
|
@@ -25,7 +31,7 @@ The plugin is off until you enable it. Enabling it is your consent to the spendi
|
|
|
25
31
|
- **Price guard**: before paying, the plugin reads the 402 quote and pays only if it is USDC on Base, payTo is the MoneyTools wallet `0x64eB63904Cf9688AC5B3087A72AcF9C31a273169`, and the amount is at most the published price (0.005 or 0.02 USDC).
|
|
26
32
|
- **Daily cap**: `dailyBudgetUsd` (default 0.25 USDC per UTC day, max 5).
|
|
27
33
|
- **Cache**: the same URL or spender is not checked again for `cacheMinutes` (default 10).
|
|
28
|
-
- `autoPay: false`
|
|
34
|
+
- `autoPay` (default `false`): with `false` the plugin never pays; precheck uses its free daily tier, and a check that needs payment (always the Wallet Risk Card) goes to `onCheckError`, which asks you by default.
|
|
29
35
|
|
|
30
36
|
## What it decides
|
|
31
37
|
|
|
@@ -62,7 +68,7 @@ The plugin uses OpenClaw's `before_tool_call` hook.
|
|
|
62
68
|
## Config example (`openclaw.json`)
|
|
63
69
|
|
|
64
70
|
```json
|
|
65
|
-
{ "plugins": { "entries": { "moneytools-guard": { "enabled": true, "config": { "dailyBudgetUsd": 0.1, "onMediumRisk": "allow" } } } } }
|
|
71
|
+
{ "plugins": { "entries": { "moneytools-guard": { "enabled": true, "config": { "autoPay": true, "dailyBudgetUsd": 0.1, "onMediumRisk": "allow" } } } } }
|
|
66
72
|
```
|
|
67
73
|
|
|
68
74
|
## No OpenClaw? One line with AgentCash
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "moneytools-guard",
|
|
3
3
|
"name": "MoneyTools Guard",
|
|
4
|
-
"description": "Pay precheck before every x402 payment (0.005 USDC) and a Wallet Risk Card before every token approval (0.02 USDC); blocks sanctioned or high-risk spenders.
|
|
5
|
-
"version": "0.1.
|
|
4
|
+
"description": "Pay precheck before every x402 payment (0.005 USDC) and a Wallet Risk Card before every token approval (0.02 USDC); blocks sanctioned or high-risk spenders. Paid checks are opt-in (autoPay) and paid from the agent's own wallet (X402_PRIVATE_KEY or an existing AgentCash wallet); daily cap 0.25 USDC by default; failed checks are not charged.",
|
|
5
|
+
"version": "0.1.1",
|
|
6
6
|
"categories": ["security"],
|
|
7
7
|
"enabledByDefault": false,
|
|
8
8
|
"activation": { "onStartup": true },
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"type": "object",
|
|
12
12
|
"additionalProperties": false,
|
|
13
13
|
"properties": {
|
|
14
|
-
"autoPay": { "type": "boolean", "default":
|
|
14
|
+
"autoPay": { "type": "boolean", "default": false, "description": "Opt-in. true = pay for checks automatically from the agent's wallet after the free tier (capped by dailyBudgetUsd). Default false = free tier only; checks that need payment ask you instead." },
|
|
15
15
|
"payer": { "type": "string", "enum": ["auto", "key", "agentcash", "none"], "default": "auto", "description": "auto: X402_PRIVATE_KEY if set, else an existing AgentCash wallet (~/.agentcash/wallet.json), else free tier only." },
|
|
16
16
|
"privateKeyEnv": { "type": "string", "default": "X402_PRIVATE_KEY", "description": "Name of the env var holding the agent's EVM private key (USDC on Base). The key never leaves the Gateway process." },
|
|
17
17
|
"dailyBudgetUsd": { "type": "number", "minimum": 0, "maximum": 5, "default": 0.25, "description": "Max USDC per UTC day this plugin may spend on its own checks." },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moneytools-dev/openclaw-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "OpenClaw plugin: MoneyTools pay precheck before every x402 payment and a Wallet Risk Card before every token approval. Pays from the agent's own wallet; failed checks are not charged.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
package/src/checks.js
CHANGED
|
@@ -13,7 +13,7 @@ export const USDC_BASE = "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913";
|
|
|
13
13
|
export const BASE = "eip155:8453";
|
|
14
14
|
export const PRICES = { precheck: 0.005, walletRisk: 0.02 };
|
|
15
15
|
export const AGENTCASH_VERSION = "0.17.1"; // pinned; never @latest
|
|
16
|
-
const UA = "moneytools-openclaw-plugin/0.1.
|
|
16
|
+
const UA = "moneytools-openclaw-plugin/0.1.1";
|
|
17
17
|
|
|
18
18
|
export class CheckError extends Error { constructor(code, message) { super(message); this.code = code; } }
|
|
19
19
|
|
package/src/guard.js
CHANGED
|
@@ -3,7 +3,7 @@ import { detectX402Payment, detectApproval, DEFAULT_PAYMENT_TOOL_PATTERN, CHAINS
|
|
|
3
3
|
import { callCheck, resolvePayer, makeBudget, precheckUrl, walletRiskUrl, PRICES, CheckError } from "./checks.js";
|
|
4
4
|
|
|
5
5
|
export const PLUGIN_ID = "moneytools-guard";
|
|
6
|
-
export const DEFAULTS = { autoPay:
|
|
6
|
+
export const DEFAULTS = { autoPay: false, payer: "auto", privateKeyEnv: "X402_PRIVATE_KEY", dailyBudgetUsd: 0.25, precheckPayments: true, checkApprovals: true,
|
|
7
7
|
onPrecheckWarn: "approve", onHighRisk: "block", onMediumRisk: "approve", onCheckError: "approve", defaultChain: "base", paymentToolPattern: "", cacheMinutes: 10 };
|
|
8
8
|
|
|
9
9
|
export function readConfig(raw = {}) {
|