Skip to content

Commit cba9e1a

Browse files
ryanioCodySearsOS
andcommitted
Release v0.8.0
Origin-SHA: 32f9800bc76568439c94b901220645f6e14f2fbc Co-authored-by: Cody <132297275+CodySearsOS@users.noreply.github.com>
1 parent 267c360 commit cba9e1a

9 files changed

Lines changed: 696 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pnpm run type-check # TypeScript type checking
2121
| `src/index.ts` | Library entry point — public `tool-sdk` exports |
2222
| `src/cli.ts` | CLI entry point (Commander program wiring) |
2323
| `src/types.ts` | Shared public types |
24-
| `src/cli/commands/` | CLI commands: `auth`, `deploy`, `dry-run-gate`, `dry-run-predicate-gate`, `export`, `hash`, `init`, `inspect`, `pay`, `register`, `smoke`, `update-metadata`, `validate`, `verify` |
24+
| `src/cli/commands/` | CLI commands: `auth`, `deploy`, `dry-run-gate`, `dry-run-predicate-gate`, `export`, `get-collections`, `hash`, `init`, `inspect`, `pay`, `register`, `set-collection-tokens`, `set-collections`, `smoke`, `update-metadata`, `validate`, `verify` |
2525
| `src/lib/onchain/abis.ts` | TypeScript ABI definitions mirroring Solidity interfaces |
2626
| `src/lib/onchain/chains.ts` | Deployed contract addresses per chain |
2727
| `src/lib/onchain/registry.ts` | `ToolRegistryClient` — onchain interaction wrapper |
@@ -35,6 +35,7 @@ pnpm run type-check # TypeScript type checking
3535
| `src/lib/adapters/` | Framework adapters (Vercel, Cloudflare, Express) |
3636
| `src/lib/utils.ts` | Shared utilities used across `lib/` |
3737
| `src/templates/` | Scaffolding templates for `init` command |
38+
| `src/testing/` | Test helpers exported via `@opensea/tool-sdk/testing` subpath |
3839
| `src/__tests__/` | Vitest test suite |
3940

4041
## Review Checklist

CHANGELOG.md

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

3+
## 0.8.0
4+
5+
### Minor Changes
6+
7+
- 6eacfbe: Add `IWalletStateAttestation` requirement type support (kind `0x7a111640`)
8+
9+
- New `WALLET_STATE_ATTESTATION_KIND` constant and `DecodedWalletStateAttestationRequirement` type
10+
- `decodeRequirement()` now decodes wallet-state attestation data (`issuerJwksUri`, `conditionHash`)
11+
- CLI `inspect` command displays decoded attestation fields for `WalletStateAttestationPredicate`
12+
- SKILLS.md updated with WalletStateAttestation predicate documentation
13+
314
## 0.7.1
415

516
### Patch Changes

SKILLS.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,50 @@ const op = await composite.getOp(toolId) // CompositeOp.ALL or CompositeOp.A
758758
const terms = await composite.getTerms(toolId) // [{ predicate, negate }]
759759
```
760760

761+
### WalletStateAttestationPredicate
762+
763+
Gates access based on offchain-signed wallet-state attestations. Designed for cross-chain wallet state that cannot be evaluated natively in EVM (e.g., Solana, XRPL, Bitcoin holdings). An offchain issuer evaluates conditions against the relevant chain, signs a verdict, and the onchain predicate verifies the signature via the RIP-7212 P-256 precompile.
764+
765+
| Field | Value |
766+
|-------|-------|
767+
| Requirement `kind` | `0x7a111640` (`IWalletStateAttestation` interface ID) |
768+
| Requirement `data` (getRequirements) | `abi.encode(string issuerJWKSURI, bytes32 conditionHash)` |
769+
| Proof `data` (hasAccess) | `abi.encode(bool pass, address wallet, bytes32 conditionHash, uint256 blockNumber, bytes32 r, bytes32 s, bytes32 messageHash)` |
770+
| Signature verification | ECDSA P-256 via RIP-7212 precompile (~3,450 gas) |
771+
772+
This is a third-party predicate type. No canonical deployment exists; each issuer deploys their own instance. The `IWalletStateAttestation` marker interface is not pinned in `IRequirementTypes.sol` but is a valid extension per the spec's open `kind` namespace.
773+
774+
**Decode requirements via SDK:**
775+
```typescript
776+
import { decodeRequirement, WALLET_STATE_ATTESTATION_KIND } from "@opensea/tool-sdk"
777+
778+
const decoded = decodeRequirement(req)
779+
if (decoded.type === "walletStateAttestation") {
780+
// decoded.issuerJwksUri — URL to fetch the issuer's JWKS public key set
781+
// decoded.conditionHash — identifies which condition set the predicate enforces
782+
console.log(`Issuer JWKS: ${decoded.issuerJwksUri}`)
783+
console.log(`Condition: ${decoded.conditionHash}`)
784+
}
785+
```
786+
787+
**Manifest access declaration (manual):**
788+
```json
789+
{
790+
"access": {
791+
"logic": "AND",
792+
"requirements": [
793+
{
794+
"kind": "0x7a111640",
795+
"data": "<abi.encode(string issuerJWKSURI, bytes32 conditionHash)>",
796+
"label": "Cross-chain wallet attestation required"
797+
}
798+
]
799+
}
800+
}
801+
```
802+
803+
**Reference implementation:** [douglasborthwick-crypto/insumer-examples](https://github.com/douglasborthwick-crypto/insumer-examples)
804+
761805
### SDK Helpers for Reading Predicate Requirements
762806

763807
Use `describeToolAccess` to read a tool's predicate name, requirements, and logic from the registry, and `decodeRequirement` to decode the raw `kind`/`data` into typed objects:
@@ -780,6 +824,9 @@ for (const req of description.requirements) {
780824
case "subscription":
781825
console.log(`Requires subscription (min tier ${decoded.minTier}) from ${decoded.collection}`)
782826
break
827+
case "walletStateAttestation":
828+
console.log(`Requires attestation from ${decoded.issuerJwksUri} (condition: ${decoded.conditionHash})`)
829+
break
783830
case "unknown":
784831
console.log(`Unknown requirement kind ${decoded.kind}`)
785832
break

0 commit comments

Comments
 (0)