π§ Dubhe Engine Client SDK
Type-safe TypeScript SDK for seamless blockchain interaction
v2.0.0TypeScriptReal-time
Package:
License: Apache-2.0
GitHub: View Source
@0xobelisk/dubhe-clientLicense: Apache-2.0
GitHub: View Source
π¦ Installation
- npm
- yarn
- pnpm
β‘ Quick Start
ποΈ DubheClient Class
Constructor
DubheClientConfig
ClientOptions
π Component Operations
getComponent()
Retrieve a single component for an entity.Parameters
Example
queryComponents()
Query multiple components with filtering.Parameters
Example
π« Transaction Operations
System Transactions
Access generated system transaction builders through thetx property:
Example
signAndExecute()
Sign and execute a transaction block.TransactionResult
Example
π Real-time Subscriptions
Subscriptions use WebSocket connections for real-time updates. Remember to clean up subscriptions when components unmount.
subscribe()
Subscribe to real-time component updates.Parameters
Example
subscribeToComponent()
Subscribe to all entities of a specific component type.Example
β οΈ Error Handling
Common Errors
Error Handling Example
π Performance Tips
Best Practices for Optimal Performance
Best Practices for Optimal Performance
- Enable caching for frequently accessed data
- Batch operations to reduce network calls
- Use selective subscriptions to minimize data transfer
- Implement pagination for large datasets
- Handle errors gracefully with retry logic
Caching
Enable caching for frequently accessed data:Batch Operations
Batch multiple queries for better performance:Selective Subscriptions
Only subscribe to components you actively display:π― Next Steps
Smart Contracts
Explore Move contract interfaces
Schema Definitions
Understand data structures
Tutorial
Build your first DApp