@tuwaio/quasar-sdk
v0.0.2
Published
The official server-side Node.js & Edge SDK for the TUWA Quasar Cloud.
Readme
Quasar SDK
The official server-side Node.js & Edge SDK for the TUWA Quasar Cloud.
Installation
# Using pnpm (recommended), but you can use npm, yarn or bun as well
pnpm add @tuwaio/quasar-sdk ofetchPeer Dependencies
| Package | Version |
| --------------------- | --------- |
| @tuwaio/pulsar-core | >=0.6.0 |
| ofetch | >=1.5.1 |
Quick Start
import { Quasar } from '@tuwaio/quasar-sdk';
const quasar = new Quasar({ secretKey: 'sk_live_your_secret_key' });
// Sync a pending transaction
const { txKey } = await quasar.pulsar.syncCreate(tx, 'My Application');
// Update status
await quasar.pulsar.syncUpdate(txKey, { status: 'confirmed' });
// Query history
const history = await quasar.pulsar.getHistory({ chainId: 1 });Modules
Pulsar — quasar.pulsar
| Method | Description |
| ---------------------------- | ------------------------------------------------- |
| syncCreate(tx, appName?) | Sync a new pending transaction to the cloud |
| syncUpdate(txKey, patches) | Update an existing transaction's status or fields |
| getHistory(query?) | Retrieve paginated transaction history |
Error Handling
import { QuasarSDKError } from '@tuwaio/quasar-sdk';
try {
await quasar.pulsar.getHistory();
} catch (err) {
if (err instanceof QuasarSDKError) {
console.error(err.status); // HTTP status code
console.error(err.message); // Formatted error message
console.error(err.originalError); // Raw fetch error
}
}Configuration
| Property | Type | Required | Default | Description |
| ----------- | -------- | -------- | --------------------- | --------------------------------- |
| secretKey | string | ✅ | — | Server-side API key (sk_live_*) |
| baseUrl | string | ❌ | https://api.tuwa.io | API base URL |
| timeout | number | ❌ | 10000 | Request timeout (ms) |
Documentation
Full API reference: sdk.docs.tuwa.io
🤝 Contributing & Support
Contributions are welcome! Please read our main Contribution Guidelines.
If you find this library useful, please consider supporting its development. Every contribution helps!
📄 License
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.
