@@ -40,7 +40,7 @@ Noosphere SDK enables you to build and run compute agents that participate in th
4040npm install @noosphere/sdk
4141
4242# Or install individual packages
43- npm install @noosphere/agent-core @noosphere/crypto @noosphere/contracts @noosphere/registry
43+ npm install @noosphere/agent-core @noosphere/crypto @noosphere/contracts @noosphere/registry @noosphere/payload
4444```
4545
4646### Basic Example
@@ -94,6 +94,14 @@ await agent.start();
9494│ ├── EventMonitor (blockchain events) │
9595│ └── ContainerManager (Docker execution) │
9696├─────────────────────────────────────────────────────────┤
97+ │ @noosphere/payload (browser & Node.js) │
98+ │ ├── PayloadResolver (URI-based payload handling) │
99+ │ └── Storage providers │
100+ │ ├── IpfsStorage (IPFS/Pinata) │
101+ │ ├── S3Storage (S3/R2/MinIO) │
102+ │ ├── DataUriStorage (inline data) │
103+ │ └── HttpStorage (HTTP/HTTPS) │
104+ ├─────────────────────────────────────────────────────────┤
97105│ @noosphere/contracts │
98106│ ├── ABIs (contract interfaces) │
99107│ ├── TypeChain types (type-safe wrappers) │
@@ -127,6 +135,32 @@ await agent.start();
127135- ` EventMonitor ` - Blockchain event listener with WebSocket support
128136- ` ContainerManager ` - Docker container execution
129137
138+ ### [ @noosphere/payload ] ( ./packages/payload ) · [ npm] ( https://www.npmjs.com/package/@noosphere/payload )
139+
140+ PayloadData utilities for URI-based payload handling. Works in both browser and Node.js environments.
141+
142+ ``` typescript
143+ import { PayloadResolver , createDataUriPayload } from ' @noosphere/payload' ;
144+
145+ // Create PayloadData
146+ const payload = createDataUriPayload (' {"action": "ping"}' );
147+
148+ // Resolve PayloadData
149+ const resolver = new PayloadResolver ({ ipfs: { gateway: ' https://ipfs.io/ipfs/' } });
150+ const { content, verified } = await resolver .resolve (payload );
151+ ```
152+
153+ ** Key Components:**
154+ - ` PayloadResolver ` - Resolves and encodes PayloadData with verification
155+ - ` IpfsStorage ` - IPFS/Pinata storage provider
156+ - ` S3Storage ` - S3/R2/MinIO storage provider
157+ - ` DataUriStorage ` - Inline base64 data URI provider
158+
159+ ** Supported URI Schemes:**
160+ - ` data: ` - Inline base64-encoded data
161+ - ` ipfs:// ` - IPFS content addressing
162+ - ` https:// ` / ` http:// ` - HTTP(S) URLs
163+
130164### [ @noosphere/contracts ] ( ./packages/contracts ) · [ npm] ( https://www.npmjs.com/package/@noosphere/contracts )
131165
132166Type-safe contract interfaces and ABIs.
@@ -205,6 +239,54 @@ if (verifier.requiresProof && verifier.proofService) {
205239}
206240```
207241
242+ ### Payload Resolution
243+
244+ The SDK includes ` PayloadResolver ` for handling URI-based payload data with multiple storage backends.
245+
246+ ``` typescript
247+ import { PayloadResolver } from ' @noosphere/agent-core' ;
248+
249+ const resolver = new PayloadResolver ({
250+ // IPFS configuration
251+ ipfs: {
252+ gateway: ' https://gateway.pinata.cloud/ipfs/' ,
253+ apiEndpoint: ' https://api.pinata.cloud' ,
254+ apiKey: process .env .PINATA_API_KEY ,
255+ apiSecret: process .env .PINATA_API_SECRET ,
256+ },
257+ // S3-compatible storage (R2, S3, MinIO)
258+ s3: {
259+ endpoint: process .env .R2_ENDPOINT ,
260+ accessKeyId: process .env .R2_ACCESS_KEY_ID ,
261+ secretAccessKey: process .env .R2_SECRET_ACCESS_KEY ,
262+ bucket: process .env .R2_BUCKET ,
263+ publicUrlBase: process .env .R2_PUBLIC_URL ,
264+ },
265+ // Auto-upload threshold (bytes)
266+ uploadThreshold: 1024 ,
267+ // Default storage for large payloads
268+ defaultStorage: ' s3' , // 'ipfs' | 's3' | 'data'
269+ });
270+
271+ // Resolve PayloadData from various URI schemes
272+ const { content, verified } = await resolver .resolve (payloadData );
273+ // Supports: data:, ipfs://, https://, http://
274+
275+ // Encode output (auto-uploads if > threshold)
276+ const outputPayload = await resolver .encode (outputContent );
277+ ```
278+
279+ ** Supported URI Schemes:**
280+ - ` data: ` - Inline base64-encoded data
281+ - ` ipfs:// ` - IPFS content addressing
282+ - ` https:// ` / ` http:// ` - HTTP(S) URLs
283+
284+ ** Storage Backends:**
285+ - ` IpfsStorage ` - Pinata IPFS pinning service
286+ - ` S3Storage ` - S3-compatible storage (AWS S3, Cloudflare R2, MinIO)
287+ - ` DataUriStorage ` - Inline data URI encoding
288+ - ` HttpStorage ` - HTTP(S) fetch
289+
208290## Usage Examples
209291
210292### Running a Compute Agent
@@ -324,6 +406,18 @@ RPC_URL=https://...
324406# Optional
325407WS_URL=wss://...
326408WALLET_FACTORY_ADDRESS=0x...
409+
410+ # Payload Storage (S3/R2)
411+ R2_ENDPOINT=https://xxx.r2.cloudflarestorage.com
412+ R2_ACCESS_KEY_ID=your-access-key
413+ R2_SECRET_ACCESS_KEY=your-secret-key
414+ R2_BUCKET=your-bucket
415+ R2_PUBLIC_URL=https://pub-xxx.r2.dev
416+
417+ # Payload Storage (IPFS/Pinata)
418+ PINATA_API_KEY=your-api-key
419+ PINATA_API_SECRET=your-api-secret
420+ IPFS_GATEWAY=https://gateway.pinata.cloud/ipfs/
327421```
328422
329423### Keystore Structure
0 commit comments