@chaoschain/sdk 0.1.2 → 0.2.2
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/CHANGELOG.md +138 -0
- package/README.md +741 -174
- package/dist/index.js +13104 -400
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13066 -375
- package/dist/index.mjs.map +1 -1
- package/dist/providers/compute/index.js.map +1 -1
- package/dist/providers/compute/index.mjs.map +1 -1
- package/dist/providers/storage/index.js +5 -5
- package/dist/providers/storage/index.js.map +1 -1
- package/dist/providers/storage/index.mjs +5 -5
- package/dist/providers/storage/index.mjs.map +1 -1
- package/package.json +25 -42
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the ChaosChain TypeScript SDK will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.0] - Unreleased
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
#### Gateway Integration
|
|
13
|
+
- **GatewayClient**: Full Gateway service integration for workflow orchestration
|
|
14
|
+
- `healthCheck()`: Check Gateway service health
|
|
15
|
+
- `submitWork()`: Submit work with evidence and multi-agent attribution
|
|
16
|
+
- `submitScore()`: Submit scores with commit-reveal or direct mode
|
|
17
|
+
- `closeEpoch()`: Close epoch and trigger reward distribution
|
|
18
|
+
- `getWorkflow()`: Get workflow status by ID
|
|
19
|
+
- `listWorkflows()`: List workflows with filters
|
|
20
|
+
- `waitForCompletion()`: Poll until workflow completes
|
|
21
|
+
- Gateway client accessible via `sdk.gateway`
|
|
22
|
+
|
|
23
|
+
#### Studio Client (Direct On-Chain Operations)
|
|
24
|
+
- **StudioClient**: Direct contract interaction for testing and low-level control
|
|
25
|
+
- `createStudio()`: Create new Studio via ChaosCore contract
|
|
26
|
+
- `registerWithStudio()`: Register agent with stake
|
|
27
|
+
- `submitWork()`: Direct work submission (deprecated, use Gateway)
|
|
28
|
+
- `submitWorkMultiAgent()`: Multi-agent work with contribution weights (deprecated, use Gateway)
|
|
29
|
+
- `commitScore()`: Commit score hash (commit-reveal phase 1)
|
|
30
|
+
- `revealScore()`: Reveal score (commit-reveal phase 2)
|
|
31
|
+
- `submitScoreVector()`: Direct score submission
|
|
32
|
+
- `submitScoreVectorForWorker()`: Per-worker score submission for multi-agent tasks
|
|
33
|
+
- `closeEpoch()`: Close epoch via RewardsDistributor
|
|
34
|
+
- `getPendingRewards()`: Check withdrawable balance
|
|
35
|
+
- `withdrawRewards()`: Withdraw accumulated rewards
|
|
36
|
+
- Helper methods: `computeScoreCommitment()`, `encodeScoreVector()`, `generateSalt()`
|
|
37
|
+
- Studio client accessible via `sdk.studio`
|
|
38
|
+
|
|
39
|
+
#### Contract ABIs
|
|
40
|
+
- Added ChaosCore ABI for Studio creation
|
|
41
|
+
- Added StudioProxy ABI for agent registration, work submission, and scoring
|
|
42
|
+
- Added RewardsDistributor ABI for epoch management
|
|
43
|
+
- Added `submitScoreVector` and `submitScoreVectorForWorker` to StudioProxy ABI
|
|
44
|
+
|
|
45
|
+
#### SDK Integration
|
|
46
|
+
- Convenience methods on ChaosChainSDK:
|
|
47
|
+
- `createStudio()`: Create new Studio
|
|
48
|
+
- `registerWithStudio()`: Register with Studio
|
|
49
|
+
- `getStudioPendingRewards()`: Check rewards
|
|
50
|
+
- `withdrawStudioRewards()`: Withdraw rewards
|
|
51
|
+
|
|
52
|
+
#### Documentation
|
|
53
|
+
- Architecture diagram showing ChaosChain Protocol components
|
|
54
|
+
- ChaosChain Protocol section explaining Studios, Epochs, Workers, Verifiers
|
|
55
|
+
- Gateway Integration documentation with code examples
|
|
56
|
+
- Studio Client documentation with method tables
|
|
57
|
+
- Multi-agent work and per-worker scoring explanation
|
|
58
|
+
- Complete Studio workflow example
|
|
59
|
+
- Verifier agent example
|
|
60
|
+
- Updated FAQ with Gateway and Studio questions
|
|
61
|
+
- Added Gateway and Studio methods to API reference
|
|
62
|
+
|
|
63
|
+
#### Tests
|
|
64
|
+
- 18 new tests for StudioClient covering:
|
|
65
|
+
- Validation (stake, weights, contract addresses)
|
|
66
|
+
- Helper methods (commitment, encoding, salt generation)
|
|
67
|
+
- Commit-reveal pattern integration
|
|
68
|
+
- Deprecation warnings
|
|
69
|
+
|
|
70
|
+
### Changed
|
|
71
|
+
|
|
72
|
+
- Updated Reputation Registry ABI to Feb 2026 spec
|
|
73
|
+
- Refactored deprecated AgentRole aliases for type clarity
|
|
74
|
+
- Enhanced X402 payment requirements with Python SDK alignment
|
|
75
|
+
- Improved wallet type handling for HDNodeWallet
|
|
76
|
+
- Updated maximum timeout in X402 payment tests to 300 seconds
|
|
77
|
+
- Streamlined crypto and form data imports
|
|
78
|
+
|
|
79
|
+
### Fixed
|
|
80
|
+
|
|
81
|
+
- Agent ID caching for improved performance
|
|
82
|
+
- Type safety improvements for agent metadata retrieval
|
|
83
|
+
|
|
84
|
+
## [0.1.3] - Previous Release
|
|
85
|
+
|
|
86
|
+
- Initial ERC-8004 v1.0 implementation
|
|
87
|
+
- x402 payment integration with Coinbase protocol
|
|
88
|
+
- Pluggable storage providers (IPFS, Pinata, Irys)
|
|
89
|
+
- Multi-network support (Sepolia, Base Sepolia, Linea Sepolia, Hedera, 0G)
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Migration Guide: 0.1.x to 0.2.0
|
|
94
|
+
|
|
95
|
+
### Using the Gateway (Recommended for Production)
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// Before: Direct contract interaction (still available but deprecated)
|
|
99
|
+
await sdk.studio.submitWork(studioAddress, dataHash, threadRoot, evidenceRoot);
|
|
100
|
+
|
|
101
|
+
// After: Use Gateway for production workflows
|
|
102
|
+
const workflow = await sdk.gateway.submitWork({
|
|
103
|
+
studioAddress,
|
|
104
|
+
dataHash,
|
|
105
|
+
threadRoot,
|
|
106
|
+
evidenceRoot,
|
|
107
|
+
participants: ['0xWorker1'],
|
|
108
|
+
contributionWeights: [10000],
|
|
109
|
+
evidenceCid: 'bafybei...',
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Multi-Agent Work Attribution
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
// Submit work with multiple contributors
|
|
117
|
+
await sdk.gateway.submitWork({
|
|
118
|
+
studioAddress,
|
|
119
|
+
dataHash,
|
|
120
|
+
threadRoot,
|
|
121
|
+
evidenceRoot,
|
|
122
|
+
participants: ['0xWorker1', '0xWorker2'],
|
|
123
|
+
contributionWeights: [6000, 4000], // Must sum to 10000 (basis points)
|
|
124
|
+
evidenceCid,
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Scoring with Commit-Reveal
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
// Gateway handles commit-reveal automatically
|
|
132
|
+
await sdk.gateway.submitScore({
|
|
133
|
+
studioAddress,
|
|
134
|
+
dataHash,
|
|
135
|
+
scores: [85, 90, 78, 92, 88], // 5-dimensional scores
|
|
136
|
+
mode: 'COMMIT_REVEAL', // or 'DIRECT'
|
|
137
|
+
});
|
|
138
|
+
```
|