@aircraftworth/hedera-logger
v0.1.0
Published
Lightweight Hedera HCS logging and HTS token minting for any Node.js application. Log structured events to Hedera Consensus Service with retry, batching, and async support.
Maintainers
Readme
@aircraftworth/hedera-logger
Lightweight Hedera HCS logging and HTS token minting for any Node.js application.
Installation
npm install @aircraftworth/hedera-logger @hashgraph/sdkQuick Start
import { HederaLogger } from '@aircraftworth/hedera-logger'
const logger = new HederaLogger({
operatorId: process.env.HEDERA_OPERATOR_ID!,
operatorKey: process.env.HEDERA_OPERATOR_KEY!,
network: 'testnet'
})
const result = await logger.log({
topicId: '0.0.7968510',
payload: { type: 'my_event', value: 42 }
})
console.log(`Logged to HCS — Seq #${result.sequenceNumber}`)Features
- ✅ HCS Logging: Structured event logging with automatic retries
- ✅ Batch Processing: Parallel message submission with concurrency control
- ✅ HTS Minting: Token/NFT creation with metadata
- ✅ MLAT Helper: Built-in MLAT position logging + token minting
- ✅ Type Safety: Full TypeScript definitions, no
anytypes - ✅ Network Support: Testnet, previewnet, mainnet
- ✅ Production Ready: Optimized builds for CommonJS + ESM
API
HederaLogger
Main class for Hedera interactions.
Constructor
new HederaLogger(config: HederaLoggerConfig)Methods
log(options: HCSLogOptions): Promise<HCSLogResult>logBatch(options: BatchOptions): Promise<HCSBatchResult>mint(options: HTSMintOptions): Promise<HTSMintResult>logMLATPosition(options: MLATOptions): Promise<{log: HCSLogResult, token: HTSMintResult | null}>createTopic(memo?: string): Promise<string>close(): Promise<void>
License
MIT
