Overview
The IOTA Repstation SDK provides a comprehensive TypeScript API for integrating decentralized reputation management into your applications. The SDK supports both browser and server environments with full type safety.Installation
Import Paths
The SDK provides optimized bundles for different environments:Core Classes
RepstationClient
The main client class for interacting with the IOTA Repstation system:Configuration Types
RepstationConfig
Deal Management Types
Deal Creation
Deal Lifecycle
Rating System Types
Rating Creation
Provider Management Types
Provider Registration
Reputation Query Types
Reputation Profile
Provider Metadata Query Types
Usage Examples
Basic Client Setup
Working with Deals
Rating and Reputation
Error Handling
The SDK provides comprehensive error handling with custom error types:Common Error Codes
| Code | Description | Solution |
|---|---|---|
INVALID_DEAL_ID | Deal ID not found or invalid format | Verify deal ID exists and is correctly formatted |
DEAL_NOT_CLOSED | Attempting to rate before deal is closed | Close the deal first using closeDeal() |
ALREADY_RATED | User has already rated this deal | Use updateRating() instead of rate() |
NOT_PARTY_MEMBER | User is not a participant in the deal | Only deal participants can rate each other |
INVALID_SCORE | Score outside valid range (1-100) | Provide a score between 1 and 100 |
Mock Client
For development and testing, the SDK includes a mock client:Bundle Information
The SDK provides optimized bundles:- ESM Bundle:
~27KB- Modern ES modules for bundlers - CJS Bundle:
~30KB- CommonJS for Node.js compatibility - Types Bundle:
~8KB- Full TypeScript definitions - Browser Bundle: Optimized for frontend applications
- Server Bundle: Optimized for Node.js applications
Browser Compatibility
- Chrome 91+
- Firefox 90+
- Safari 14+
- Edge 91+
Node.js Compatibility
- Node.js 16+
- TypeScript 4.5+