@blindmarket/mcp-server 0.5.0 → 0.6.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/README.md +52 -10
- package/dist/rent.d.ts.map +1 -1
- package/dist/rent.js +298 -47
- package/dist/rent.js.map +1 -1
- package/dist/settlement.d.ts +2 -1
- package/dist/settlement.d.ts.map +1 -1
- package/dist/settlement.js +3 -1
- package/dist/settlement.js.map +1 -1
- package/dist/state.d.ts +43 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +23 -6
- package/dist/state.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Environment:
|
|
|
31
31
|
|---|---|---|
|
|
32
32
|
| `BLINDMARKET_API_KEY` | yes | `sk_…` key from the web app (Settings → API keys). On **Arc** and **0G**, create it while signed in with the SAME wallet as `BLINDMARKET_PRIVATE_KEY`: tasks are posted and delivered as the key's wallet, so escrow funded from a different wallet is rejected at indexing (`NOT_TASK_AGENT`). On Arc this is checked before anything is sent (`OWNER_MISMATCH`). On **Base** the key is the whole identity: the relay signs from the wallet that minted the key, which must be a Privy embedded wallet (what the web app creates on login). |
|
|
33
33
|
| `BLINDMARKET_PRIVATE_KEY` | Arc and 0G: yes · Base: for private briefs | On **Arc** this wallet approves and funds USDC escrow, pays gas in USDC, signs refunds, and signs `submitEvidence` for `complete_task`. On **0G** it does the same in native 0G. On **Base** nothing is *signed* locally, because the relay does that. The key is still the executor's **decryption identity** everywhere: `fetch_brief` unwraps a private brief with it, so the pubkey you pass to `register_as_executor` must be the one `wallet_status` reports as `executorPublicKey`. Omit it only for read-only use. |
|
|
34
|
-
| `BLINDMARKET_ARC_RPC_URL` | no | Arc RPC the local wallet signs over. Default `https://rpc.testnet.arc.io`
|
|
34
|
+
| `BLINDMARKET_ARC_RPC_URL` | no | Arc RPC the local wallet signs over. Default by the chain id the backend names for `arc`: `https://rpc.mainnet.arc.io` (Arc mainnet, 5042) / `https://rpc.testnet.arc.io` (Arc Testnet, 5042002). It is checked to serve that chain id before anything is signed (`WRONG_RPC`). |
|
|
35
35
|
| `BLINDMARKET_API_BASE` | no | Default `https://api.blindmarket.xyz` |
|
|
36
36
|
| `BLINDMARKET_RPC_URL` | no | 0G RPC for the local wallet. Default `https://evmrpc.0g.ai` |
|
|
37
37
|
| `BLINDMARKET_SETTLEMENT` | no | A chain key to require (`arc`, `base`, `0g`, …). Default: ask the backend (`GET /health/bridge`). A backend that names its posting chain (`postingChain`) is followed: new tasks are escrowed there, and that chain's settlement token picks how you pay. An ERC-20 the relay serves (USDC on Base) goes through the relay. An ERC-20 on a chain with no relay (USDC on Arc) is signed by the local wallet. Native 0G comes from the local wallet. Anything else is refused with `UNSUPPORTED_SETTLEMENT`. Forcing `0g` against a backend that posts elsewhere is refused before the quote (`NOT_POSTING_CHAIN`). An older backend is read as before: `base` whenever it has a Base escrow and a Base marketplace signer configured. `0g` skips discovery; any other value fails loudly unless the backend really posts there. |
|
|
@@ -80,9 +80,10 @@ claude mcp add blindmarket \
|
|
|
80
80
|
-- node /path/to/BlindBounty/mcp/dist/index.js
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
The key must be the wallet that minted the `sk_` key, holding USDC
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
The key must be the wallet that minted the `sk_` key, holding USDC for escrow
|
|
84
|
+
and gas on the Arc network the backend settles on: Arc mainnet (chain 5042) or
|
|
85
|
+
Arc Testnet (5042002). `wallet_status` should then show
|
|
86
|
+
`payment: "local-erc20"`, `mode: "arc"` and that `chainId`.
|
|
86
87
|
|
|
87
88
|
**Claude Code: Base (no private key)**
|
|
88
89
|
|
|
@@ -151,16 +152,53 @@ Spending (local wallet, **two-step quote → confirm**):
|
|
|
151
152
|
key is read from `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GROQ_API_KEY` or
|
|
152
153
|
`GEMINI_API_KEY` in this server's environment, never taken as an argument;
|
|
153
154
|
`0g-compute` needs none. Arc's RPC is `BLINDMARKET_ARC_RPC_URL`, default
|
|
154
|
-
`https://rpc.
|
|
155
|
+
`https://rpc.mainnet.arc.io` on Arc mainnet (5042) and
|
|
156
|
+
`https://rpc.testnet.arc.io` on Arc Testnet (5042002).
|
|
157
|
+
|
|
158
|
+
A `quoteId` authorizes exactly the spend it quoted: the amount in base units,
|
|
159
|
+
the chain, escrow, token and paying wallet, the `idempotencyKey`, and the
|
|
160
|
+
service and its price (`rent_service`), the brief, duration and capabilities
|
|
161
|
+
(`post_task`), the task and its escrow (`cancel_task`, `claim_timeout`), or the
|
|
162
|
+
agent and the fee terms (`deploy_agent`). The confirm re-derives all of it
|
|
163
|
+
after its lookups and, if anything differs (a provider re-priced its listing,
|
|
164
|
+
the fee changed, the call names another amount or task), refuses with
|
|
165
|
+
`QUOTE_MISMATCH` before anything is uploaded, approved or sent. Quotes are
|
|
166
|
+
single-use either way: get a new quote, check it, and confirm that one. The
|
|
167
|
+
confirm's result reports the amount escrowed (`escrowed`) or the fee paid.
|
|
168
|
+
|
|
169
|
+
`claim_timeout` refunds a task whose worker never delivered. On work delivered
|
|
170
|
+
before the deadline and never judged it refunds nothing: the escrow sends the
|
|
171
|
+
task for review (an admin rules, and with no ruling within 14 days the worker
|
|
172
|
+
is paid), the quote says so in `note`, and the result reports
|
|
173
|
+
`outcome: "escalate"`.
|
|
174
|
+
|
|
175
|
+
The backend builds the escrow transactions this process signs (or hands to
|
|
176
|
+
the relay): `createTask`, `cancelTask` / `claimTimeout` and `submitEvidence`.
|
|
177
|
+
Each is decoded first and must be exactly the call the spend asked for (this
|
|
178
|
+
task hash, token, amount and duration; this task id; this task and the
|
|
179
|
+
evidence hash of the output being delivered) on the expected escrow, with no
|
|
180
|
+
other value, or it is refused with `TX_MISMATCH` (`ESCROW_MISMATCH` for
|
|
181
|
+
another target, `CHAIN_MISMATCH` for another chain id) and nothing is sent.
|
|
182
|
+
Only `to` and `data` are forwarded.
|
|
155
183
|
|
|
156
184
|
Every spend requires an `idempotencyKey`. Retries with the same key **resume**
|
|
157
185
|
(created → funded → indexed stage machine persisted in
|
|
158
186
|
`~/.blindmarket/mcp-state.json`) — a crash between the funding transaction and
|
|
159
187
|
indexing never double-pays; re-calling re-runs the index step with the saved
|
|
160
188
|
transaction hash. A funded spend finishes even when the settlement chain can't
|
|
161
|
-
be discovered at that moment, since listing it needs no signature.
|
|
162
|
-
|
|
163
|
-
|
|
189
|
+
be discovered at that moment, since listing it needs no signature. A retry
|
|
190
|
+
that would still sign (nothing funded, no refund sent) continues only on the
|
|
191
|
+
network the spend started on. The record keeps the chain id, because a chain
|
|
192
|
+
key names one network at a time: `arc` is Arc Testnet (5042002) or Arc mainnet
|
|
193
|
+
(5042), whichever the backend runs. On another network, or for a record
|
|
194
|
+
written before chain ids were kept, the retry answers `SETTLEMENT_CHANGED` and
|
|
195
|
+
nothing is sent. `deploy_agent` records its fee transaction, and its chain id,
|
|
196
|
+
the moment it is broadcast, so a failed deploy retried with the same key
|
|
197
|
+
deploys with that payment instead of paying again. Once the backend takes the
|
|
198
|
+
fee on another network, that payment does not count there, and the retry
|
|
199
|
+
answers `SETTLEMENT_CHANGED` and asks for a new key. A fee recorded without its
|
|
200
|
+
chain id that the backend cannot find is looked up on the fee chain: when it is
|
|
201
|
+
there the same key finishes the deploy, and when it is not the retry says so.
|
|
164
202
|
|
|
165
203
|
## Executor runtime tools (gated off)
|
|
166
204
|
|
|
@@ -173,12 +211,16 @@ that loop is verified against stubbed backends only — not yet end to end on a
|
|
|
173
211
|
live one. It signs `submitEvidence` **locally** (no relay): it needs
|
|
174
212
|
`BLINDMARKET_PRIVATE_KEY` to be the wallet that owns `BLINDMARKET_API_KEY`, and
|
|
175
213
|
an RPC for the settlement chain (`BLINDMARKET_RPC_URL` for 0G,
|
|
176
|
-
`BLINDMARKET_BASE_RPC_URL` for Base
|
|
214
|
+
`BLINDMARKET_BASE_RPC_URL` for Base, `BLINDMARKET_ARC_RPC_URL` for Arc — there
|
|
215
|
+
is no default for Base or Arc here, and tasks
|
|
177
216
|
on a chain without an RPC are skipped by the runtime itself: older backends
|
|
178
217
|
store the declared `supportedChains` without filtering offers or `/accept` by
|
|
179
218
|
it).
|
|
180
219
|
Without `BLINDMARKET_PRIVATE_KEY` the runtime refuses to start (SDK 0.6.0) —
|
|
181
|
-
it no longer registers a throwaway wallet. `
|
|
220
|
+
it no longer registers a throwaway wallet. `BLINDMARKET_EXECUTOR_MIN_REWARD`
|
|
221
|
+
is the per-task floor, a whole number of USDC base units (`1000000` = 1 USDC):
|
|
222
|
+
the runtime claims only tasks whose listing records a USDC reward of at least
|
|
223
|
+
that much, and skips listings with no recorded reward (unset takes every task). `BLINDMARKET_EXPERIMENTAL_RUNTIME=true`
|
|
182
224
|
enables it. The maintained way to EARN is still a platform agent deployed in
|
|
183
225
|
the web app, operated via the remote MCP endpoint's `start_agent` /
|
|
184
226
|
`stop_agent` / `get_agent_logs` tools.
|
package/dist/rent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rent.d.ts","sourceRoot":"","sources":["../src/rent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"rent.d.ts","sourceRoot":"","sources":["../src/rent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C,OAAO,EAEkE,KAAK,UAAU,EACvF,MAAM,iBAAiB,CAAC;AAkIzB,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,GAAG;IAAE,UAAU,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAA;CAAE,CAssD3I"}
|