@minia2a/elizaos-plugin-minia2a 0.2.3 → 0.2.4
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 +38 -17
- package/dist/actions/callApi.js +62 -29
- package/dist/index.d.ts +7 -5
- package/dist/index.js +8 -6
- package/dist/spending.d.ts +5 -2
- package/dist/spending.js +5 -2
- package/dist/types.d.ts +13 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# @minia2a/elizaos-plugin-minia2a
|
|
2
2
|
|
|
3
|
-
**The marketplace plugin for ElizaOS agents** — discover
|
|
3
|
+
**The marketplace plugin for ElizaOS agents** — discover and call 1,680+ x402 APIs across crypto, web, AI, and data, with live pricing surfaced on every HTTP 402. USDC on Base.
|
|
4
4
|
|
|
5
|
-
> Unlike single-vendor x402 plugins that bundle a fixed set of endpoints, this plugin connects your agent to the **entire minia2a.uk marketplace** — 1,680+ services from dozens of providers, with live discovery
|
|
5
|
+
> Unlike single-vendor x402 plugins that bundle a fixed set of endpoints, this plugin connects your agent to the **entire minia2a.uk marketplace** — 1,680+ services from dozens of providers, with live discovery and transparent pricing.
|
|
6
|
+
|
|
7
|
+
> **Scope of this version:** it does not sign trials and does not settle payments. `CALL_API` returns the endpoint's response, or on 402 reports the price plus the exact signed-trial recipe for your agent to follow. Neither the trial message nor a USDC payment is signed for you.
|
|
6
8
|
|
|
7
9
|
## Why This Plugin
|
|
8
10
|
|
|
@@ -10,10 +12,10 @@
|
|
|
10
12
|
|---------|----------------------|-------------|
|
|
11
13
|
| Services | 8–75 endpoints | **1,680+ across categories** |
|
|
12
14
|
| Discovery | Pre-bundled at build time | **Live marketplace search** |
|
|
13
|
-
| Free trials | Sometimes | **5 free trial calls per wallet** |
|
|
15
|
+
| Free trials | Sometimes | **5 free trial calls per signed wallet** (platform-side; sign the message yourself) |
|
|
14
16
|
| New services | Wait for plugin update | **Available instantly** |
|
|
15
17
|
| Provider diversity | Single vendor | **Dozens of providers** |
|
|
16
|
-
| Payment | USDC on chain | **USDC on Base (
|
|
18
|
+
| Payment | USDC on chain | **x402 / USDC on Base** (not settled by this version) |
|
|
17
19
|
|
|
18
20
|
## Install
|
|
19
21
|
|
|
@@ -30,9 +32,8 @@ Add to your agent's `character.json`:
|
|
|
30
32
|
"plugins": ["@minia2a/elizaos-plugin-minia2a"],
|
|
31
33
|
"settings": {
|
|
32
34
|
"MINIA2A_CONFIG": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"baseUrl": "https://minia2a.uk"
|
|
35
|
+
"baseUrl": "https://minia2a.uk",
|
|
36
|
+
"maxSpendPerSession": 500
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -43,21 +44,41 @@ Add to your agent's `character.json`:
|
|
|
43
44
|
| Action | What it does | Example prompt |
|
|
44
45
|
|--------|-------------|----------------|
|
|
45
46
|
| `SEARCH_APIS` | Search 1,680+ APIs by keyword or category | "Find APIs that can scrape websites" |
|
|
46
|
-
| `CALL_API` | Call any endpoint
|
|
47
|
+
| `CALL_API` | Call any endpoint; on 402 return its price + the signed-trial recipe | "Get the current gas price on Base" |
|
|
47
48
|
| `LIST_POPULAR_APIS` | Browse trending services | "What are the most used APIs?" |
|
|
48
49
|
|
|
49
50
|
## Provider
|
|
50
51
|
|
|
51
52
|
The `MINIA2A_MARKETPLACE` provider injects live marketplace context into every agent interaction — service counts, popular endpoints, trial availability, and pricing.
|
|
52
53
|
|
|
53
|
-
##
|
|
54
|
+
## What happens on HTTP 402
|
|
55
|
+
|
|
56
|
+
1. Agent calls an endpoint → the gateway answers `402 Payment Required`.
|
|
57
|
+
2. The challenge is in the **`payment-required` response header** (base64 JSON with an
|
|
58
|
+
`accepts[]` array). `CALL_API` decodes it and reports the price, e.g. `0.5 USDC on eip155:8453`.
|
|
59
|
+
3. The agent then either **pays via x402 itself** (`PAYMENT-SIGNATURE` V2 / `X-PAYMENT` V1)
|
|
60
|
+
or **draws a free trial** with a signed wallet — see below.
|
|
61
|
+
4. A successful call carries a receipt in the **`x-minia2a-receipt`** header, which `CALL_API`
|
|
62
|
+
surfaces in its reply.
|
|
63
|
+
|
|
64
|
+
This plugin performs steps 1–2 and 4. It does **not** perform step 3: no trial signature and no
|
|
65
|
+
payment is produced for you. `paymentPrivateKey` is accepted by the config but has no signer
|
|
66
|
+
behind it, so setting it changes nothing.
|
|
67
|
+
|
|
68
|
+
### Free trials (5 per signed wallet, no registration)
|
|
54
69
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
70
|
+
Trials are wallet-based, not a URL parameter. A bare `?trial=1` draws nothing — the gateway
|
|
71
|
+
documents that explicitly in its [AGENTS.md](https://minia2a.uk/AGENTS.md). To draw one:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
message = "minia2a trial:" + wallet + ":" + serviceId + ":" + unixSeconds # EIP-191
|
|
75
|
+
GET /x402/<svc>?wallet=<wallet>
|
|
76
|
+
X-Wallet-Signature: <signature>
|
|
77
|
+
X-Trial-Timestamp: <unixSeconds>
|
|
78
|
+
# → 200 + x-trial-remaining: 4, x-trial-max: 5
|
|
79
|
+
```
|
|
59
80
|
|
|
60
|
-
|
|
81
|
+
`serviceId` is the catalog `id` (e.g. `x402-gas`), **not** the URL path segment (`gas`).
|
|
61
82
|
|
|
62
83
|
## Categories
|
|
63
84
|
|
|
@@ -70,10 +91,10 @@ The `MINIA2A_MARKETPLACE` provider injects live marketplace context into every a
|
|
|
70
91
|
|
|
71
92
|
## Pricing
|
|
72
93
|
|
|
73
|
-
- **Free trial:** 5
|
|
74
|
-
- **Paid calls:** Priced per endpoint (typically $0.001–$0.10)
|
|
94
|
+
- **Free trial:** 5 calls per signed wallet, one allowance across the whole catalog — see above
|
|
95
|
+
- **Paid calls:** Priced per endpoint (typically $0.001–$0.10), charged in USDC per call
|
|
75
96
|
- **Platform fee:** 5% (transparent, no hidden costs)
|
|
76
|
-
- **
|
|
97
|
+
- **No credits, no subscription, no minimum** — the platform's unit is USDC (microUSDC balances)
|
|
77
98
|
- **Settlement:** USDC on Base (~3¢ gas, ~2s confirmation)
|
|
78
99
|
|
|
79
100
|
## Related
|
package/dist/actions/callApi.js
CHANGED
|
@@ -3,6 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.callApiAction = void 0;
|
|
4
4
|
const spending_1 = require("../spending");
|
|
5
5
|
const DEFAULT_BASE_URL = "https://minia2a.uk";
|
|
6
|
+
/**
|
|
7
|
+
* A 402 from the gateway carries the canonical challenge in the
|
|
8
|
+
* `payment-required` response header: base64(JSON) with an `accepts[]` array.
|
|
9
|
+
* `WWW-Authenticate` / `X-Payment-Required` are legacy shapes this gateway does
|
|
10
|
+
* not send; reading only those (as an earlier version did) left the price blank.
|
|
11
|
+
*/
|
|
12
|
+
function readChallenge(res) {
|
|
13
|
+
const raw = res.headers.get("payment-required") || res.headers.get("PAYMENT-REQUIRED");
|
|
14
|
+
if (!raw)
|
|
15
|
+
return { nextSteps: [] };
|
|
16
|
+
try {
|
|
17
|
+
const json = JSON.parse(Buffer.from(raw, "base64").toString("utf8"));
|
|
18
|
+
const accept = Array.isArray(json.accepts) ? json.accepts[0] : undefined;
|
|
19
|
+
const amount = accept?.amount;
|
|
20
|
+
const usd = amount != null ? Number(amount) / 1e6 : NaN;
|
|
21
|
+
return {
|
|
22
|
+
price: Number.isFinite(usd) ? `${usd} USDC on ${accept?.network || "?"}` : undefined,
|
|
23
|
+
error: typeof json.message === "string" ? json.message : undefined,
|
|
24
|
+
nextSteps: Array.isArray(json.nextSteps)
|
|
25
|
+
? json.nextSteps.filter((s) => typeof s === "string")
|
|
26
|
+
: [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return { nextSteps: [] };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const TRIAL_HOW_TO = "\n\n**Free trials are wallet-based.** Sign `minia2a trial:<wallet>:<service-id>:<unixSeconds>`" +
|
|
34
|
+
" (EIP-191), then send `?wallet=` together with the `X-Wallet-Signature` and `X-Trial-Timestamp`" +
|
|
35
|
+
" headers to draw 5 free calls — no registration. This plugin does not sign that message for you." +
|
|
36
|
+
" A bare `?trial=1` draws nothing; the gateway says so in its own AGENTS.md.";
|
|
6
37
|
exports.callApiAction = {
|
|
7
38
|
name: "CALL_API",
|
|
8
39
|
similes: [
|
|
@@ -15,7 +46,7 @@ exports.callApiAction = {
|
|
|
15
46
|
"X402_CALL",
|
|
16
47
|
"MINIA2A_CALL",
|
|
17
48
|
],
|
|
18
|
-
description: "Call an x402 API endpoint on minia2a.uk
|
|
49
|
+
description: "Call an x402 API endpoint on minia2a.uk and return its response. On HTTP 402 it reports the price and the exact signed-trial recipe. It does not sign trials and does not settle payments.",
|
|
19
50
|
validate: async (_runtime, message, _state) => {
|
|
20
51
|
const text = message.content?.text?.toLowerCase() || "";
|
|
21
52
|
const triggers = [
|
|
@@ -35,7 +66,6 @@ exports.callApiAction = {
|
|
|
35
66
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
36
67
|
const config = runtime.getSetting("MINIA2A_CONFIG") || {};
|
|
37
68
|
const baseUrl = config.baseUrl || DEFAULT_BASE_URL;
|
|
38
|
-
const autoTrial = config.autoTrial !== false; // default true
|
|
39
69
|
const maxSpend = config.maxSpendPerSession || 0;
|
|
40
70
|
// Initialize session spending tracker if budget is configured
|
|
41
71
|
if (maxSpend > 0) {
|
|
@@ -77,19 +107,16 @@ exports.callApiAction = {
|
|
|
77
107
|
}
|
|
78
108
|
}
|
|
79
109
|
}
|
|
80
|
-
// Step 1: Send
|
|
110
|
+
// Step 1: Send the request.
|
|
111
|
+
// There is no request header that grants a trial. Older versions set
|
|
112
|
+
// `x402-trial: true`, which the gateway ignores — it returned a 402
|
|
113
|
+
// byte-identical to the unheadered baseline, under a "with free trial"
|
|
114
|
+
// message. Trials are drawn by a signed wallet (see TRIAL_HOW_TO).
|
|
81
115
|
const headers = {
|
|
82
116
|
"Content-Type": "application/json",
|
|
83
117
|
};
|
|
84
|
-
if (autoTrial) {
|
|
85
|
-
headers["x402-trial"] = "true";
|
|
86
|
-
}
|
|
87
118
|
if (callback) {
|
|
88
|
-
callback({
|
|
89
|
-
text: autoTrial
|
|
90
|
-
? `🆓 Calling ${endpoint} with free trial...`
|
|
91
|
-
: `📡 Calling ${endpoint}...`,
|
|
92
|
-
});
|
|
119
|
+
callback({ text: `📡 Calling ${endpoint}...` });
|
|
93
120
|
}
|
|
94
121
|
let res = await fetch(`${baseUrl}${endpoint}`, {
|
|
95
122
|
method: body && Object.keys(body).length > 0 ? "POST" : "GET",
|
|
@@ -100,15 +127,19 @@ exports.callApiAction = {
|
|
|
100
127
|
});
|
|
101
128
|
// Step 2: Handle HTTP 402 Payment Required
|
|
102
129
|
if (res.status === 402) {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
""
|
|
130
|
+
const challenge = readChallenge(res);
|
|
131
|
+
const head = `💳 **Payment Required**\n\nEndpoint: ${endpoint}` +
|
|
132
|
+
(challenge.price ? `\nPrice: ${challenge.price}` : "") +
|
|
133
|
+
(challenge.error ? `\nGateway: ${challenge.error}` : "") +
|
|
134
|
+
(challenge.nextSteps.length
|
|
135
|
+
? `\n\nGateway next steps:\n${challenge.nextSteps.map((s) => `- ${s}`).join("\n")}`
|
|
136
|
+
: "");
|
|
106
137
|
if (!config.paymentPrivateKey) {
|
|
107
138
|
return {
|
|
108
|
-
text:
|
|
139
|
+
text: head + TRIAL_HOW_TO,
|
|
109
140
|
success: false,
|
|
110
141
|
paymentRequired: true,
|
|
111
|
-
paymentDetails:
|
|
142
|
+
paymentDetails: challenge.price,
|
|
112
143
|
};
|
|
113
144
|
}
|
|
114
145
|
// Budget check before payment
|
|
@@ -116,25 +147,24 @@ exports.callApiAction = {
|
|
|
116
147
|
const budgetCheck = (0, spending_1.canAfford)(runtime.agentId, 1); // approximate 1¢ minimum check
|
|
117
148
|
if (!budgetCheck.allowed) {
|
|
118
149
|
return {
|
|
119
|
-
text: `🛑 ${budgetCheck.reason}\n\nUse
|
|
150
|
+
text: `🛑 ${budgetCheck.reason}\n\nUse a signed wallet trial (see below) or increase maxSpendPerSession in config.` + TRIAL_HOW_TO,
|
|
120
151
|
success: false,
|
|
121
152
|
budgetExceeded: true,
|
|
122
153
|
};
|
|
123
154
|
}
|
|
124
155
|
}
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
// Extract payment address and amount from 402 headers
|
|
130
|
-
// The actual USDC signing would use ethers.js or viem
|
|
131
|
-
// For now, return payment instructions
|
|
132
|
-
// TODO: Implement full x402 payment flow (sign USDC tx → retry with X-PAYMENT header)
|
|
156
|
+
// `paymentPrivateKey` is accepted by this plugin but had no payment
|
|
157
|
+
// signer behind it: an earlier version printed "auto-signing USDC on
|
|
158
|
+
// Base..." and then returned instructions without signing anything.
|
|
159
|
+
// Report that plainly instead of implying a settlement.
|
|
133
160
|
return {
|
|
134
|
-
text:
|
|
161
|
+
text: head +
|
|
162
|
+
"\n\n**No payment was made.** `paymentPrivateKey` is configured, but this version has no" +
|
|
163
|
+
" x402 signer wired to it — nothing was signed and no USDC was sent." +
|
|
164
|
+
TRIAL_HOW_TO,
|
|
135
165
|
success: false,
|
|
136
166
|
paymentRequired: true,
|
|
137
|
-
paymentDetails:
|
|
167
|
+
paymentDetails: challenge.price,
|
|
138
168
|
};
|
|
139
169
|
}
|
|
140
170
|
// Step 3: Handle response
|
|
@@ -151,10 +181,13 @@ exports.callApiAction = {
|
|
|
151
181
|
? data
|
|
152
182
|
: JSON.stringify(data, null, 2)
|
|
153
183
|
: "OK (no response body)";
|
|
184
|
+
// The gateway names this `x-minia2a-receipt` (not `X-Receipt`).
|
|
185
|
+
const receipt = res.headers.get("x-minia2a-receipt");
|
|
154
186
|
return {
|
|
155
|
-
text: `✅ **${endpoint}** response:\n\n\`\`\`json\n${resultText.slice(0, 2000)}\n\`\`\`${resultText.length > 2000 ? "\n\n...(truncated)" : ""}`,
|
|
187
|
+
text: `✅ **${endpoint}** response:\n\n\`\`\`json\n${resultText.slice(0, 2000)}\n\`\`\`${resultText.length > 2000 ? "\n\n...(truncated)" : ""}${receipt ? `\n\nReceipt: \`${receipt}\`` : ""}`,
|
|
156
188
|
success: true,
|
|
157
189
|
data,
|
|
190
|
+
receipt: receipt || undefined,
|
|
158
191
|
};
|
|
159
192
|
}
|
|
160
193
|
catch (error) {
|
|
@@ -186,7 +219,7 @@ exports.callApiAction = {
|
|
|
186
219
|
{
|
|
187
220
|
user: "{{user2}}",
|
|
188
221
|
content: {
|
|
189
|
-
text: "
|
|
222
|
+
text: "💳 /x402/gas returned HTTP 402 — 0.5 USDC on eip155:8453. To draw a free trial, sign \"minia2a trial:<wallet>:x402-gas:<unixSeconds>\" and send it with ?wallet= and the X-Wallet-Signature / X-Trial-Timestamp headers.",
|
|
190
223
|
action: "CALL_API",
|
|
191
224
|
},
|
|
192
225
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -11,17 +11,19 @@ export { initSpendingTracker, getSpending, getSpendSummary, canAfford, recordSpe
|
|
|
11
11
|
*
|
|
12
12
|
* Gives your ElizaOS agent the ability to:
|
|
13
13
|
* - Search 1,680+ x402 pay-per-call APIs (SEARCH_APIS)
|
|
14
|
-
* - Call any endpoint
|
|
14
|
+
* - Call any endpoint and, on 402, get its price + the signed-trial recipe (CALL_API)
|
|
15
15
|
* - Browse trending/popular services (LIST_POPULAR_APIS)
|
|
16
|
-
* - Track
|
|
16
|
+
* - Track API spending per session (VIEW_SPENDING)
|
|
17
17
|
* - Get marketplace stats injected into agent context (MINIA2A_MARKETPLACE provider)
|
|
18
18
|
*
|
|
19
|
+
* What this version does NOT do: it does not sign trials and does not settle
|
|
20
|
+
* payments. A 402 is reported to you, never paid.
|
|
21
|
+
*
|
|
19
22
|
* Configuration via character.json settings.MINIA2A_CONFIG:
|
|
20
23
|
* - baseUrl: minia2a marketplace URL (default: https://minia2a.uk)
|
|
21
|
-
* - autoTrial: use free trials automatically (default: true)
|
|
22
|
-
* - maxPricePerCall: max USD per paid call (default: 0, trials only)
|
|
23
24
|
* - maxSpendPerSession: total USD cents budget cap per session (0 = unlimited)
|
|
24
|
-
* - paymentPrivateKey:
|
|
25
|
+
* - autoTrial, maxPricePerCall, paymentPrivateKey: accepted but not used —
|
|
26
|
+
* there is no signed-trial path and no x402 signer behind them.
|
|
25
27
|
*
|
|
26
28
|
* @example
|
|
27
29
|
* ```json
|
package/dist/index.js
CHANGED
|
@@ -28,17 +28,19 @@ Object.defineProperty(exports, "resetSpending", { enumerable: true, get: functio
|
|
|
28
28
|
*
|
|
29
29
|
* Gives your ElizaOS agent the ability to:
|
|
30
30
|
* - Search 1,680+ x402 pay-per-call APIs (SEARCH_APIS)
|
|
31
|
-
* - Call any endpoint
|
|
31
|
+
* - Call any endpoint and, on 402, get its price + the signed-trial recipe (CALL_API)
|
|
32
32
|
* - Browse trending/popular services (LIST_POPULAR_APIS)
|
|
33
|
-
* - Track
|
|
33
|
+
* - Track API spending per session (VIEW_SPENDING)
|
|
34
34
|
* - Get marketplace stats injected into agent context (MINIA2A_MARKETPLACE provider)
|
|
35
35
|
*
|
|
36
|
+
* What this version does NOT do: it does not sign trials and does not settle
|
|
37
|
+
* payments. A 402 is reported to you, never paid.
|
|
38
|
+
*
|
|
36
39
|
* Configuration via character.json settings.MINIA2A_CONFIG:
|
|
37
40
|
* - baseUrl: minia2a marketplace URL (default: https://minia2a.uk)
|
|
38
|
-
* - autoTrial: use free trials automatically (default: true)
|
|
39
|
-
* - maxPricePerCall: max USD per paid call (default: 0, trials only)
|
|
40
41
|
* - maxSpendPerSession: total USD cents budget cap per session (0 = unlimited)
|
|
41
|
-
* - paymentPrivateKey:
|
|
42
|
+
* - autoTrial, maxPricePerCall, paymentPrivateKey: accepted but not used —
|
|
43
|
+
* there is no signed-trial path and no x402 signer behind them.
|
|
42
44
|
*
|
|
43
45
|
* @example
|
|
44
46
|
* ```json
|
|
@@ -58,7 +60,7 @@ Object.defineProperty(exports, "resetSpending", { enumerable: true, get: functio
|
|
|
58
60
|
exports.minia2aPlugin = {
|
|
59
61
|
name: "@minia2a/elizaos-plugin-minia2a",
|
|
60
62
|
npmName: "@minia2a/elizaos-plugin-minia2a",
|
|
61
|
-
description: "Discover and call 1,680+ x402 pay-per-call APIs from minia2a.uk.
|
|
63
|
+
description: "Discover and call 1,680+ x402 pay-per-call APIs from minia2a.uk. Live marketplace search, spending tracking, and the signed-trial recipe on HTTP 402. This version does not sign trials and does not settle payments.",
|
|
62
64
|
config: {
|
|
63
65
|
baseUrl: "https://minia2a.uk",
|
|
64
66
|
autoTrial: true,
|
package/dist/spending.d.ts
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
* Session-level spending tracker for budget controls.
|
|
3
3
|
*
|
|
4
4
|
* Tracks cumulative spend within a single agent session.
|
|
5
|
-
* When maxSpendPerSession is configured,
|
|
6
|
-
* once
|
|
5
|
+
* When maxSpendPerSession is configured, CALL_API reports the budget as
|
|
6
|
+
* exhausted once it is spent, instead of returning the 402 challenge.
|
|
7
|
+
*
|
|
8
|
+
* Note: this version never settles a payment, so `totalCents` stays at 0 and
|
|
9
|
+
* the cap cannot bind in practice. It is wired, not meaningful yet.
|
|
7
10
|
*/
|
|
8
11
|
interface SessionSpend {
|
|
9
12
|
totalCents: number;
|
package/dist/spending.js
CHANGED
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
* Session-level spending tracker for budget controls.
|
|
4
4
|
*
|
|
5
5
|
* Tracks cumulative spend within a single agent session.
|
|
6
|
-
* When maxSpendPerSession is configured,
|
|
7
|
-
* once
|
|
6
|
+
* When maxSpendPerSession is configured, CALL_API reports the budget as
|
|
7
|
+
* exhausted once it is spent, instead of returning the 402 challenge.
|
|
8
|
+
*
|
|
9
|
+
* Note: this version never settles a payment, so `totalCents` stays at 0 and
|
|
10
|
+
* the cap cannot bind in practice. It is wired, not meaningful yet.
|
|
8
11
|
*/
|
|
9
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
13
|
exports.initSpendingTracker = initSpendingTracker;
|
package/dist/types.d.ts
CHANGED
|
@@ -31,11 +31,21 @@ export interface Minia2aApiResponse {
|
|
|
31
31
|
export interface Minia2aPluginConfig {
|
|
32
32
|
/** Base URL of the minia2a marketplace (default: https://minia2a.uk) */
|
|
33
33
|
baseUrl?: string;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Reserved. Accepted and ignored: this version has no signed-trial path, so
|
|
36
|
+
* there is no auto-trial to toggle. It previously set an `x402-trial` request
|
|
37
|
+
* header the gateway ignores.
|
|
38
|
+
*/
|
|
35
39
|
autoTrial?: boolean;
|
|
36
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Accepted and NOT enforced. This version never settles a payment, so there
|
|
42
|
+
* is nothing to cap; the value is not read anywhere.
|
|
43
|
+
*/
|
|
37
44
|
maxPricePerCall?: number;
|
|
38
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Accepted and NOT used. No x402 signer is wired to it — nothing is signed
|
|
47
|
+
* and no USDC is sent, whether or not this is set.
|
|
48
|
+
*/
|
|
39
49
|
paymentPrivateKey?: string;
|
|
40
50
|
/** Maximum total spend in USD cents allowed per agent session (0 = unlimited) */
|
|
41
51
|
maxSpendPerSession?: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minia2a/elizaos-plugin-minia2a",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "ElizaOS plugin for the minia2a.uk marketplace
|
|
3
|
+
"version": "0.2.4",
|
|
4
|
+
"description": "ElizaOS plugin for the minia2a.uk marketplace \u2014 1,680+ x402 pay-per-call APIs across crypto, web, AI, and data. 5 free trial calls per wallet. USDC on Base.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|