Skip to content

Commit fe26d33

Browse files
ryanioCodySearsOS
andcommitted
Release v0.3.0
Co-authored-by: Cody <132297275+CodySearsOS@users.noreply.github.com>
1 parent d4eaf5d commit fe26d33

23 files changed

Lines changed: 1761 additions & 81 deletions

AGENTS.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,21 @@ When reviewing changes to this package, verify:
4343

4444
1. **ABI completeness**: `abis.ts` must include every function and event from the corresponding Solidity interfaces in `../tool-registry/src/interfaces/`. If the Solidity interface adds a function, `abis.ts` must add it too. Missing ABI entries mean SDK consumers cannot call those functions.
4545

46-
2. **Address sync**: Addresses in `chains.ts` must match `../tool-registry/README.md`. After a new deploy, both files must be updated together.
46+
2. **Address sync**: Addresses in `chains.ts` must match `../tool-registry/README.md`. After a new deploy, both files must be updated together. Also update `SKILLS.md` — it hardcodes contract addresses in the "Deployed Contracts" table and code examples.
4747

48-
3. **Dead code after refactors**: When removing features (e.g., dropping a predicate factory), verify that all related imports, constants, and references are also removed. Check for unused imports at the top of refactored files.
48+
3. **SKILLS.md sync**: `SKILLS.md` hardcodes requirement-type selectors (`kind` values from `IRequirementTypes.sol`) and contract addresses. When any of these change in `tool-registry`, update `SKILLS.md` in the same PR:
49+
- Deployed addresses → "Deployed Contracts" table + code examples
50+
- `IRequirementTypes.sol` selectors → `kind` fields in "Known Predicates" section
51+
- New predicates in `../tool-registry/examples/` → new entry in "Known Predicates"
52+
- CLI commands added/removed in `src/cli/index.ts` → CLI commands table in Section 9
4953

50-
4. **CLI error messages**: Error messages shown to SDK consumers should not reference internal file paths (e.g., "Update chains.ts"). Link to the README or provide actionable instructions instead.
54+
4. **Dead code after refactors**: When removing features (e.g., dropping a predicate factory), verify that all related imports, constants, and references are also removed. Check for unused imports at the top of refactored files.
5155

52-
5. **Multi-step CLI flows**: Commands that require multiple onchain transactions (e.g., `register --nft-gate` does `registerTool` then `setCollections`) must handle partial failure gracefully — print recovery instructions if the second TX fails.
56+
5. **CLI error messages**: Error messages shown to SDK consumers should not reference internal file paths (e.g., "Update chains.ts"). Link to the README or provide actionable instructions instead.
5357

54-
6. **`--dry-run` accuracy**: Dry-run output must reflect the full onchain footprint. If the command sends multiple transactions, the dry-run should mention all of them.
58+
6. **Multi-step CLI flows**: Commands that require multiple onchain transactions (e.g., `register --nft-gate` does `registerTool` then `setCollections`) must handle partial failure gracefully — print recovery instructions if the second TX fails.
59+
60+
7. **`--dry-run` accuracy**: Dry-run output must reflect the full onchain footprint. If the command sends multiple transactions, the dry-run should mention all of them.
5561

5662
## Conventions
5763

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# @opensea/tool-sdk
22

3+
## 0.3.0
4+
5+
### Minor Changes
6+
7+
- ef922d8: Migrate `auth` and `smoke` CLI commands from `TOOL_SDK_PRIVATE_KEY` / `privateKeyToAccount` to `createWalletFromEnv()` from `@opensea/wallet-adapters`. Both commands now use `PRIVATE_KEY` (via wallet-adapters) instead of the non-standard `TOOL_SDK_PRIVATE_KEY` env var, and accept the `--wallet-provider` flag for explicit provider selection. This makes wallet configuration consistent across all CLI commands (`auth`, `pay`, `smoke`, `register`, `update-metadata`).
8+
9+
**Breaking:** `--key` (auth), `--as` (smoke), and `TOOL_SDK_PRIVATE_KEY` env var have been removed. Use `PRIVATE_KEY` + `RPC_URL` env vars or `--wallet-provider` instead.
10+
11+
- f6ef66e: feat: add delegated agent auth via delegate.xyz for predicate-gated tools
12+
- 80bfd16: feat(manifest): validate inputs/outputs as well-formed JSON Schema
13+
- fde8ef0: feat: add ERC721OwnerPredicateClient and ERC1155OwnerPredicateClient for managing predicate collections
14+
- 6b31470: feat(predicate-gate): accept registryAddress override for local development
15+
16+
`PredicateGateConfig` and `ToolRegistryClient` now accept an optional `registryAddress` field. When provided, the middleware and client use the given address instead of looking up the canonical `TOOL_REGISTRY` deployment. This enables local development against a forked Anvil node or a custom registry deploy without monkey-patching the SDK.
17+
18+
- 1368f61: feat: support runtime env resolution in defineManifest for Cloudflare Workers
19+
20+
### Patch Changes
21+
22+
- 1b3a388: feat(init): update Vercel template with agent-friendly discovery page and llms.txt
23+
24+
The `tool-sdk init` template now scaffolds an index.html that serves as an
25+
llms.txt-style discovery page — showing agents the manifest location, endpoint,
26+
auth requirements (SIWE), input/output schemas, and SDK usage examples. Also adds
27+
a `/llms.txt` plaintext file following the llms.txt spec for direct LLM consumption.
28+
29+
Updated to use `createWalletFromEnv` / `walletAdapterToClient` from
30+
`@opensea/wallet-adapters` instead of raw `privateKeyToAccount`. Added coverage
31+
for x402 payment flows (`pay` command, `paidAuthenticatedFetch`), smoke-testing,
32+
and multi-provider wallet configuration (Privy, Turnkey, Fireblocks).
33+
34+
- b5307e4: fix(deploy): skip blank-valued env vars in .env.local.example during deploy wizard
35+
- 7da1fae: fix(deploy): skip env var prompts for vars already set in Vercel
36+
337
## 0.2.0
438

539
### Minor Changes

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,42 @@ Authorization header format: `SIWE <base64url(siwe-message)>.<hex-signature>`
356356
> Tool operators requiring stronger replay protection should implement
357357
> server-side nonce tracking.
358358
359+
#### Delegated agent access (delegate.xyz)
360+
361+
An AI agent can call a predicate-gated tool **on behalf of** an NFT holder
362+
without the holder's private key. The holder delegates to the agent at
363+
[delegate.xyz](https://delegate.xyz) (onchain, one TX, revocable anytime),
364+
and the agent includes the holder's address in the request:
365+
366+
```typescript
367+
import { authenticatedFetch } from "@opensea/tool-sdk"
368+
369+
const response = await authenticatedFetch(toolUrl, {
370+
method: "POST",
371+
headers: {
372+
"X-Delegate-For": holderAddress, // holder who delegated
373+
},
374+
account: agentAccount,
375+
body: JSON.stringify({ query: "hello" }),
376+
})
377+
```
378+
379+
When `X-Delegate-For` is present, the middleware:
380+
381+
1. Verifies the agent's SIWE signature normally
382+
2. Calls `checkDelegateForAll(agent, holder)` on the [delegate.xyz DelegateRegistry](https://docs.delegate.xyz)
383+
3. If valid, runs the access predicate against the **holder** (not the agent)
384+
4. Sets `ctx.callerAddress = holderAddress` and `ctx.agentAddress = agentAddress`
385+
386+
| Outcome | Status | Body |
387+
| --- | --- | --- |
388+
| Invalid `X-Delegate-For` format | `400` | `{ error }` |
389+
| Delegation not found onchain | `403` | `{ error, hint }` |
390+
| Delegate registry call failed | `502` | `{ error }` |
391+
392+
See [docs/predicate-gating-guide.md](docs/predicate-gating-guide.md) for the
393+
full delegation walkthrough.
394+
359395
### Client-side access preview
360396

361397
Off-chain helper for clients that want to gate UI before invocation. Same

0 commit comments

Comments
 (0)