@insumermodel/plugin-eliza 2.0.0
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/LICENSE +21 -0
- package/README.md +253 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1377 -0
- package/dist/index.js.map +1 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Insumer Model
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# eliza-plugin-insumer
|
|
2
|
+
|
|
3
|
+
ElizaOS plugin for [InsumerAPI](https://insumermodel.com) — 10 actions for condition-based access across 33 blockchains.
|
|
4
|
+
|
|
5
|
+
An agent can go from zero to running a condition-based commerce operation with no human involvement: provision an API key with USDC, create a merchant, configure which tokens gate access, add credits, verify wallets, run ACP/UCP commerce flows, and confirm payments — all autonomously.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install eliza-plugin-insumer
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Configure
|
|
14
|
+
|
|
15
|
+
### 1. Get a free API key (instant, no credit card)
|
|
16
|
+
|
|
17
|
+
Generate one from your terminal — no browser needed:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
curl -s -X POST https://api.insumermodel.com/v1/keys/create \
|
|
21
|
+
-H "Content-Type: application/json" \
|
|
22
|
+
-d '{"email": "you@example.com", "appName": "ElizaOS Agent", "tier": "free"}' | jq .
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Returns an `insr_live_...` key with 100 reads/day and 10 verification credits. One free key per email.
|
|
26
|
+
|
|
27
|
+
Or visit [insumermodel.com/developers](https://insumermodel.com/developers/) to get one.
|
|
28
|
+
|
|
29
|
+
### 2. Add to your character file
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"plugins": ["eliza-plugin-insumer"],
|
|
34
|
+
"settings": {
|
|
35
|
+
"secrets": {
|
|
36
|
+
"INSUMER_API_KEY": "insr_live_your_key_here"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Or set the environment variable:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
export INSUMER_API_KEY=insr_live_your_key_here
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Full Autonomous Flow
|
|
49
|
+
|
|
50
|
+
The 10 actions cover the complete agent lifecycle — no human required at any step:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
BUY_API_KEY → Provision API key with USDC/USDT/BTC (no auth needed)
|
|
54
|
+
CREATE_MERCHANT → Create merchant profile (100 free credits)
|
|
55
|
+
CONFIGURE_TOKENS → Set which tokens gate discounts + tier thresholds
|
|
56
|
+
ADD_CREDITS → Top up merchant credits with USDC
|
|
57
|
+
VERIFY_WALLET → Verify token/NFT/attestation conditions (1-10 per call)
|
|
58
|
+
CHECK_TRUST → Generate 36-check wallet trust profile
|
|
59
|
+
CHECK_TRUST_BATCH → Profile up to 10 wallets in one call
|
|
60
|
+
ACP_DISCOUNT → Check discount in OpenAI/Stripe ACP format
|
|
61
|
+
UCP_DISCOUNT → Check discount in Google UCP format
|
|
62
|
+
CONFIRM_PAYMENT → Confirm on-chain USDC payment for discount code
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Actions
|
|
66
|
+
|
|
67
|
+
### BUY_API_KEY
|
|
68
|
+
|
|
69
|
+
Buy a new InsumerAPI key with USDC, USDT, or BTC. No existing API key required — the sender wallet from the transaction becomes the key's identity. One key per wallet.
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
User: "I sent 10 USDC on Base, tx 0xabc123. Create an API key called TrustBot."
|
|
73
|
+
Agent: [calls BUY_API_KEY → POST /v1/keys/buy]
|
|
74
|
+
|
|
75
|
+
API key created successfully!
|
|
76
|
+
Key: insr_live_...
|
|
77
|
+
Name: TrustBot
|
|
78
|
+
Credits: 250
|
|
79
|
+
Wallet: 0x...
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### CREATE_MERCHANT
|
|
83
|
+
|
|
84
|
+
Create a new merchant. The agent's API key owns the merchant. Receives 100 free verification credits.
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
User: "Create a merchant called Acme Coffee with ID acme-coffee in New York."
|
|
88
|
+
Agent: [calls CREATE_MERCHANT → POST /v1/merchants]
|
|
89
|
+
|
|
90
|
+
Merchant created successfully!
|
|
91
|
+
ID: acme-coffee
|
|
92
|
+
Name: Acme Coffee
|
|
93
|
+
Credits: 100 (free starter credits)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### CONFIGURE_TOKENS
|
|
97
|
+
|
|
98
|
+
Configure which tokens gate access to merchant discounts. Up to 8 tokens with 1-4 discount tiers each. Supports all 30 EVM chains plus Solana and XRPL.
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
User: "Set up USDC gating for acme-coffee: Bronze at 100 (5%), Silver at 1000 (10%), Gold at 10000 (15%) on Ethereum."
|
|
102
|
+
Agent: [calls CONFIGURE_TOKENS → PUT /v1/merchants/{id}/tokens]
|
|
103
|
+
|
|
104
|
+
Token tiers configured for acme-coffee!
|
|
105
|
+
Total tokens: 1/8
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### ADD_CREDITS
|
|
109
|
+
|
|
110
|
+
Buy merchant verification credits with USDC, USDT, or BTC. Credits are consumed by discount code generation.
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
User: "I sent 20 USDC on Base (tx 0xabc123) to top up credits for acme-coffee."
|
|
114
|
+
Agent: [calls ADD_CREDITS → POST /v1/merchants/{id}/credits]
|
|
115
|
+
|
|
116
|
+
Credits added to acme-coffee!
|
|
117
|
+
Credits added: 500
|
|
118
|
+
Total credits: 600
|
|
119
|
+
USDC paid: 20
|
|
120
|
+
Chain: Base
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### VERIFY_WALLET
|
|
124
|
+
|
|
125
|
+
Verify 1-10 on-chain conditions (token balances, NFT ownership, EAS attestations, Farcaster identity) across 33 chains. Returns ECDSA-signed boolean results.
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
User: "Check if 0xd8dA... holds at least 100 UNI"
|
|
129
|
+
Agent: [calls VERIFY_WALLET → POST /v1/attest]
|
|
130
|
+
|
|
131
|
+
Attestation ATST-A7C3E1B2D4F56789: PASS
|
|
132
|
+
[+] UNI balance >= 100 (chain 1)
|
|
133
|
+
1 passed, 0 failed
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### CHECK_TRUST
|
|
137
|
+
|
|
138
|
+
Generate a structured wallet trust profile with 36 base checks (up to 40 with Solana, XRPL, and Bitcoin) across stablecoins, governance tokens, NFTs, and staking. Optional cross-chain with Solana and XRPL wallets.
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
User: "What's the trust profile for 0xd8dA...?"
|
|
142
|
+
Agent: [calls CHECK_TRUST → POST /v1/trust]
|
|
143
|
+
|
|
144
|
+
Trust Profile TRST-B2K4F
|
|
145
|
+
stablecoins: 5/7 passed
|
|
146
|
+
governance: 2/4 passed
|
|
147
|
+
nfts: 1/3 passed
|
|
148
|
+
staking: 2/3 passed
|
|
149
|
+
Overall: 22/36 checks passed
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### CHECK_TRUST_BATCH
|
|
153
|
+
|
|
154
|
+
Profile up to 10 wallets in a single request. 5-8x faster than sequential calls via shared block fetches.
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
User: "Check trust for these wallets: 0xd8dA..., 0xAb58..., 0x1234..."
|
|
158
|
+
Agent: [calls CHECK_TRUST_BATCH → POST /v1/trust/batch]
|
|
159
|
+
|
|
160
|
+
Batch Trust: 3 profiles
|
|
161
|
+
0xd8dA...: 22/36 checks passed (TRST-B2K4F)
|
|
162
|
+
0xAb58...: 14/36 checks passed (TRST-C3L5G)
|
|
163
|
+
0x1234...: 6/36 checks passed (TRST-D4M6H)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### ACP_DISCOUNT
|
|
167
|
+
|
|
168
|
+
Check discount eligibility in OpenAI/Stripe Agentic Commerce Protocol format. Returns coupon objects, allocations, and a signed verification code. Costs 1 merchant credit.
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
User: "Check ACP discount for 0xd8dA... at merchant acme-coffee."
|
|
172
|
+
Agent: [calls ACP_DISCOUNT → POST /v1/acp/discount]
|
|
173
|
+
|
|
174
|
+
ACP Discount Result
|
|
175
|
+
Verification code: INSR-A7K3M
|
|
176
|
+
Discount: 10%
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### UCP_DISCOUNT
|
|
180
|
+
|
|
181
|
+
Check discount eligibility in Google Universal Commerce Protocol format. Returns title-based discounts and a signed verification code. Costs 1 merchant credit.
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
User: "Check UCP discount for 0xd8dA... at merchant acme-coffee."
|
|
185
|
+
Agent: [calls UCP_DISCOUNT → POST /v1/ucp/discount]
|
|
186
|
+
|
|
187
|
+
UCP Discount Result
|
|
188
|
+
Verification code: INSR-B8L4N
|
|
189
|
+
Discount: 10%
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### CONFIRM_PAYMENT
|
|
193
|
+
|
|
194
|
+
Confirm that a USDC payment was made on-chain for a discount code. Verifies the transaction receipt to ensure USDC arrived at the merchant address.
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
User: "Confirm payment for code INSR-A7K3M. I sent 25 USDC on Base, tx 0xdef456."
|
|
198
|
+
Agent: [calls CONFIRM_PAYMENT → POST /v1/payment/confirm]
|
|
199
|
+
|
|
200
|
+
Payment confirmed!
|
|
201
|
+
Code: INSR-A7K3M
|
|
202
|
+
Amount verified: 25 USDC
|
|
203
|
+
Chain: Base
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Wallet Auth (JWT)
|
|
207
|
+
|
|
208
|
+
The VERIFY_WALLET action supports `format: "jwt"` when the user requests a JWT or bearer token. The response includes a standard ES256-signed JWT alongside the attestation, verifiable by any JWT library via the JWKS endpoint at `GET /v1/jwks`. Use this for direct API gateway integration (Kong, Nginx, Cloudflare Access, AWS API Gateway).
|
|
209
|
+
|
|
210
|
+
## Provider: WALLET_CREDENTIALS
|
|
211
|
+
|
|
212
|
+
Automatically detects wallet addresses (EVM, Solana, XRPL) in conversation and signals that verification actions are available. Dynamic — only activates when wallet patterns are found.
|
|
213
|
+
|
|
214
|
+
## Handling `rpc_failure` Errors
|
|
215
|
+
|
|
216
|
+
If the API cannot reach one or more data sources after retries, actions return `ok: false` with error code `rpc_failure`. No signature, no JWT, no credits charged. This is a retryable error — the agent should retry after 2-5 seconds.
|
|
217
|
+
|
|
218
|
+
**Important:** `rpc_failure` is NOT a verification failure. Do not treat it as `pass: false`. It means the data source was temporarily unavailable and the API refused to sign an unverified result.
|
|
219
|
+
|
|
220
|
+
## Supported Chains (33)
|
|
221
|
+
|
|
222
|
+
30 EVM chains + Solana + XRP Ledger + Bitcoin. Includes Ethereum, Base, Polygon, Arbitrum, Optimism, BNB Chain, Avalanche, and 23 more. [Full list →](https://insumermodel.com/developers/api-reference/)
|
|
223
|
+
|
|
224
|
+
## Pricing
|
|
225
|
+
|
|
226
|
+
**Tiers:** Free (100 reads/day, 10 credits) | Pro $29/mo (1,000 credits/mo, 10,000/day) | Enterprise $99/mo (5,000 credits/mo, 100,000/day)
|
|
227
|
+
|
|
228
|
+
**Volume discounts:** $5–$99 = $0.04/call (25 credits/$1) · $100–$499 = $0.03 (33/$1, 25% off) · $500+ = $0.02 (50/$1, 50% off)
|
|
229
|
+
|
|
230
|
+
**Platform wallets:**
|
|
231
|
+
- **EVM (USDC/USDT):** `0xAd982CB19aCCa2923Df8F687C0614a7700255a23`
|
|
232
|
+
- **Solana (USDC/USDT):** `6a1mLjefhvSJX1sEX8PTnionbE9DqoYjU6F6bNkT4Ydr`
|
|
233
|
+
- **Bitcoin:** `bc1qg7qnerdhlmdn899zemtez5tcx2a2snc0dt9dt0`
|
|
234
|
+
|
|
235
|
+
**Supported payment chains:** Ethereum, Base, Polygon, Arbitrum, Optimism, BNB Chain, Avalanche, Solana, Bitcoin. Tokens sent on unsupported chains cannot be recovered. All purchases are final and non-refundable. [Full pricing →](https://insumermodel.com/pricing/)
|
|
236
|
+
|
|
237
|
+
## Also Available As
|
|
238
|
+
|
|
239
|
+
- **MCP Server:** `npx -y mcp-server-insumer` ([npm](https://www.npmjs.com/package/mcp-server-insumer))
|
|
240
|
+
- **LangChain:** `pip install langchain-insumer` ([PyPI](https://pypi.org/project/langchain-insumer/))
|
|
241
|
+
- **OpenAI GPT:** [GPT Store](https://chatgpt.com/g/g-67bf98eb32dc8191a4051de54f7e2c6e-insumer-api-assistant)
|
|
242
|
+
|
|
243
|
+
## Links
|
|
244
|
+
|
|
245
|
+
- [API Documentation](https://insumermodel.com/developers/api-reference/)
|
|
246
|
+
- [OpenAPI Spec](https://insumermodel.com/openapi.yaml)
|
|
247
|
+
- [API Topology](https://insumermodel.com/workbench/)
|
|
248
|
+
|
|
249
|
+
## License
|
|
250
|
+
|
|
251
|
+
MIT
|
|
252
|
+
|
|
253
|
+
---
|