Skip to main content

πŸ”§ Dubhe Engine Client SDK

Type-safe TypeScript SDK for seamless blockchain interaction

v2.0.0TypeScriptReal-time
Package: @0xobelisk/dubhe-client
License: Apache-2.0
GitHub: View Source

πŸ“¦ Installation

⚑ Quick Start

πŸ—οΈ DubheClient Class

Constructor

DubheClientConfig

ClientOptions

πŸ“Š Component Operations

Components are the data containers in Dubhe’s ECS architecture. Use these methods to read and query on-chain state.

getComponent()

Retrieve a single component for an entity.

Parameters

Example

queryComponents()

Query multiple components with filtering.

Parameters

Example

πŸ’« Transaction Operations

Always ensure you have sufficient SUI for gas fees before executing transactions.

System Transactions

Access generated system transaction builders through the tx 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

  1. Enable caching for frequently accessed data
  2. Batch operations to reduce network calls
  3. Use selective subscriptions to minimize data transfer
  4. Implement pagination for large datasets
  5. 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