minia2a-skill 1.3.0 → 1.3.2

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 CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  **Agents can't open bank accounts. We fixed that.**
20
20
 
21
- minia2a is an agent-only marketplace for x402 microservices — AI agents discover, call, and pay per call in USDC. No human signup, no KYC. Register with your own self-custody wallet for 500 free credits, then call any of 1,600+ endpoints. Sellers list an endpoint and earn USDC per call.
21
+ minia2a is an agent-only marketplace for x402 microservices — AI agents discover, call, and pay per call in USDC. No human signup, no KYC. Register with your own self-custody wallet for 5 free trial calls, then call any of 1,680 endpoints. Sellers list an endpoint and earn USDC per call.
22
22
 
23
23
  Built on [x402](https://x402.org/) (HTTP 402, Linux Foundation standard). [minia2a.uk](https://minia2a.uk) is the reference marketplace — this repo is the agent SDK.
24
24
 
@@ -31,7 +31,7 @@ curl -sSL https://minia2a.uk/install | bash
31
31
  # Discover services
32
32
  minia2a discover
33
33
 
34
- # Register your wallet → 500 free credits
34
+ # Register your wallet → 5 free trial calls
35
35
  minia2a register --name "My Agent" --wallet 0x... --signature 0x...
36
36
 
37
37
  # Call a service (credits decrement per call)
@@ -73,7 +73,8 @@ minia2a meta
73
73
  minia2a register --name <n> --wallet <0x...> --signature <0x...>
74
74
  minia2a publish --name <n> --endpoint <url> --price <cents> --description <text> \
75
75
  [--category tools|premium|defi|data] --wallet <0x...> --signature <0x...>
76
- minia2a call <id> --wallet <0x...> [--input '{}'] [--probe]
76
+ minia2a call <id> --wallet <0x...> [--signature <0x...> --timestamp <unix>] \
77
+ [--input '{}'] [--probe]
77
78
  minia2a help
78
79
  ```
79
80
 
@@ -81,6 +82,12 @@ minia2a help
81
82
  **seller** side (it lists your API for pay-per-call). They are different endpoints
82
83
  and sign different messages — registering does not create a listing.
83
84
 
85
+ `call` signs a third, per-call message: `minia2a trial:<wallet>:<serviceId>:<unixSeconds>`.
86
+ The `serviceId` there is the catalog id (`x402-time`), **not** the URL slug (`time`) — signing
87
+ the slug fails with the same 402 a bad signature returns, so the CLI resolves the id for you and
88
+ prints the exact string to sign. Without `--signature`, `--wallet` cannot draw on the wallet's
89
+ trial allowance — anonymous trials are disabled, so the call returns 402.
90
+
84
91
  All commands output JSON. Exit code 0 = success. `--probe` returns the 402 payment JSON without consuming credits.
85
92
 
86
93
  ## Agent Wrappers
@@ -104,18 +111,20 @@ curl -sSL https://minia2a.uk/install | bash
104
111
  # 2. Browse available services
105
112
  minia2a discover
106
113
 
107
- # 3. Register (self-custody wallet + EIP-191 signature) → 500 free credits
114
+ # 3. Register (self-custody wallet + EIP-191 signature) → 5 free trial calls
108
115
  minia2a register --name "My Agent" --wallet 0x... --signature 0x...
109
116
 
110
- # 4. Call a service credits decrement, no payment needed while you have credits
117
+ # 4. Call a service. Run it once and the CLI prints the exact message to sign
118
+ # for the wallet's own 5 trial calls.
111
119
  minia2a call x402-time --wallet 0x...
120
+ minia2a call x402-time --wallet 0x... --timestamp 1787113324 --signature 0x...
112
121
  ```
113
122
 
114
123
  ## Pricing
115
124
 
116
125
  | Item | Amount |
117
126
  |------|--------|
118
- | Free credits | 500 on registration (through Sep 1, 2026) |
127
+ | Free trials | 5 calls on registration |
119
128
  | Platform fee | 5% |
120
129
  | Currency | USDC on Base (`eip155:8453`) + Algorand (ASA 31566704) |
121
130
  | Price signal | HTTP 402 `accepts[].amount` (micro-units, e.g. `"100000"` = $0.10) |
package/cli/minia2a CHANGED
@@ -14,12 +14,13 @@ Usage:
14
14
  minia2a register --name <n> --wallet <0x...> --signature <0x...>
15
15
  minia2a publish --name <n> --endpoint <url> --price <cents> --description <text>
16
16
  [--category <cat>] --wallet <0x...> --signature <0x...>
17
- minia2a call <service-id> --wallet <0x...> [--input <json>] [--probe]
17
+ minia2a call <service-id> --wallet <0x...> [--signature <0x...> --timestamp <unix>]
18
+ [--input <json>] [--probe]
18
19
  minia2a help [topic]
19
20
 
20
21
  No human signup. Register with a self-custody wallet + EIP-191 signature
21
- for 500 free credits (through Sep 1, 2026). Pay per call in USDC via x402
22
- (HTTP 402) once credits run out. Full guide: https://minia2a.uk/AGENTS.md
22
+ for 5 free trial calls. Pay per call in USDC via x402
23
+ (HTTP 402) once trials run out. Full guide: https://minia2a.uk/AGENTS.md
23
24
  `;
24
25
 
25
26
  function bail(msg, code = 1) {
@@ -205,8 +206,31 @@ async function call(id) {
205
206
  const url = new URL(ep);
206
207
  url.searchParams.set(probe ? 'probe' : 'wallet', probe ? '1' : wallet);
207
208
 
209
+ // A registered wallet's own 5 trials are only reachable with a signed call. The signed
210
+ // message uses the catalog id (x402-time), not the URL slug (time) — signing the slug fails
211
+ // with exactly the 402 a bad signature produces, so print the id-correct message rather than
212
+ // letting the caller guess it.
213
+ const trialHeaders = {};
214
+ const signature = flag('signature');
215
+ if (!probe && wallet && wallet !== true) {
216
+ const ts = flag('timestamp') && flag('timestamp') !== true
217
+ ? String(flag('timestamp'))
218
+ : String(Math.floor(Date.now() / 1000));
219
+ if (signature && signature !== true) {
220
+ trialHeaders['X-Wallet-Signature'] = signature;
221
+ trialHeaders['X-Trial-Timestamp'] = ts;
222
+ } else {
223
+ console.error('Note: --wallet alone cannot draw on the wallet\'s trial bucket — anonymous trials are disabled. To use the wallet\'s own 5 trials, sign');
224
+ console.error('this exact message (EIP-191 personal_sign):\n');
225
+ console.error(` minia2a trial:${wallet}:${svc.id}:${ts}\n`);
226
+ console.error('then rerun within 5 minutes:\n');
227
+ console.error(` minia2a call ${id} --wallet ${wallet} --timestamp ${ts} --signature 0xYOUR_SIGNATURE\n`);
228
+ console.error(`(cast example: cast wallet sign "minia2a trial:${wallet}:${svc.id}:${ts}")\n`);
229
+ }
230
+ }
231
+
208
232
  try {
209
- const opts = { headers: { 'User-Agent': 'minia2a-skill/1.x' } };
233
+ const opts = { headers: { 'User-Agent': 'minia2a-skill/1.x', ...trialHeaders } };
210
234
  let r;
211
235
  if (input !== undefined) {
212
236
  opts.method = 'POST';
@@ -222,11 +246,19 @@ async function call(id) {
222
246
  if (r.status === 402) {
223
247
  // Payment required — surface the machine-readable x402 payload.
224
248
  console.error(`Payment required (HTTP 402) for ${svc.name}. Price: $${svc.price} USDC.`);
249
+ if (trialHeaders['X-Wallet-Signature']) {
250
+ console.error(`Signed as ${wallet}: either this wallet's 5 trials are spent, or the wallet`);
251
+ console.error('is not registered, or the timestamp is older than 5 minutes.');
252
+ }
225
253
  console.error('x402 accepts[]:');
226
254
  json(d);
227
255
  process.exit(3);
228
256
  }
229
257
 
258
+ // Which bucket paid for the call — "wallet" means the signature was accepted.
259
+ const mode = r.headers.get('x-trial-mode');
260
+ if (mode) console.error(`trial: mode=${mode} remaining=${r.headers.get('x-trial-remaining') ?? '?'}`);
261
+
230
262
  json(d);
231
263
  if (!r.ok) process.exit(3);
232
264
  } catch (e) {
@@ -240,7 +272,7 @@ async function help() {
240
272
  console.error(`minia2a help: ${topic}\n`);
241
273
  console.error('The full machine-readable guide lives at https://minia2a.uk/AGENTS.md');
242
274
  console.error('Quick reference:');
243
- console.error(' register — POST /api/v1/register-simple {name, wallet, signature} → 500 free credits (BUYER side)');
275
+ console.error(' register — POST /api/v1/register-simple {name, wallet, signature} → 5 free trial calls (BUYER side)');
244
276
  console.error(' publish — POST /api/v1/publish-service {name, endpoint, price_cents, category, wallet, signature} (SELLER side)');
245
277
  console.error(' call — GET <service-endpoint>?wallet=0x... (credits decrement)');
246
278
  console.error(' probe — append ?probe=1 to any endpoint → HTTP 402 with payment JSON (free)');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "minia2a-skill",
3
- "version": "1.3.0",
4
- "description": "Agent skill for minia2a.uk — 1,600+ x402 services. AI agents earn USDC. 500 free credits. Zero-dep CLI. Try: npm i -g minia2a-cli.",
3
+ "version": "1.3.2",
4
+ "description": "Agent skill for minia2a.uk — 1,680 x402 services. AI agents earn USDC. 5 free trial calls. Zero-dep CLI. Try: npm i -g minia2a-cli.",
5
5
  "bin": {
6
6
  "minia2a": "./cli/minia2a"
7
7
  },
@@ -3,20 +3,20 @@ name: minia2a-skill
3
3
  description: >
4
4
  Discover and call x402 pay-per-call APIs on minia2a.uk — the agent-only marketplace.
5
5
  1,600+ endpoints (AI inference, crypto data, web scraping, CAPTCHA solving, more).
6
- Register with a self-custody wallet + signature for 500 free credits. USDC on Base + Algorand.
6
+ Register with a self-custody wallet + signature for 5 free trial calls. USDC on Base + Algorand.
7
7
  Commands: discover, call, register, meta, help.
8
8
  ---
9
9
 
10
10
  # minia2a-skill (Claude Code wrapper)
11
11
 
12
- Discover and call x402 microservices on the minia2a.uk marketplace. Pay per call in USDC — no human signup, no KYC. Register with your own wallet (the platform never holds your key) for 500 free credits.
12
+ Discover and call x402 microservices on the minia2a.uk marketplace. Pay per call in USDC — no human signup, no KYC. Register with your own wallet (the platform never holds your key) for 5 free trial calls.
13
13
 
14
14
  ## Commands (shell-executable, JSON output)
15
15
 
16
16
  ```bash
17
17
  npx minia2a-skill discover [query] [--category <cat>] [--sort volume|price] # list services
18
18
  npx minia2a-skill meta # x402 discovery doc
19
- npx minia2a-skill register --name <n> --wallet <0x...> --signature <0x...> # 500 free credits
19
+ npx minia2a-skill register --name <n> --wallet <0x...> --signature <0x...> # 5 free trial calls
20
20
  npx minia2a-skill call <service-id> --wallet <0x...> [--input '<json>'] [--probe]
21
21
  npx minia2a-skill help
22
22
  ```
@@ -25,7 +25,7 @@ npx minia2a-skill help
25
25
 
26
26
  1. **Discover:** `npx minia2a-skill discover "gas price"`
27
27
  2. **Probe price (free):** `npx minia2a-skill call <id> --probe` → HTTP 402 `accepts[]` (`amount` = micro-units, `"100000"` = $0.10)
28
- 3. **Register:** user signs `minia2a register: <wallet>` (EIP-191 personal_sign), then `npx minia2a-skill register --name ... --wallet 0x... --signature 0x...` → 500 credits
28
+ 3. **Register:** user signs `minia2a register: <wallet>` (EIP-191 personal_sign), then `npx minia2a-skill register --name ... --wallet 0x... --signature 0x...` → 5 free trial calls
29
29
  4. **Call:** `npx minia2a-skill call <id> --wallet 0x...` → credits decrement; HTTP 402 when exhausted
30
30
 
31
31
  ## Key facts