Files
modules/applications-economy/hyper-p2p-credit-ledger/index.js
T
2026-05-20 21:19:52 -04:00

26 lines
585 B
JavaScript

require('bare-process/global')
const EventEmitter = require('bare-events')
const PROTOCOL = 'credit-ledger/v1'
class HyperP2PCreditLedger extends EventEmitter {
constructor (opts = {}) {
super()
this.topic = opts.topic || null
this._stats = { created: 0, errors: 0 }
}
getStats () {
return { ...this._stats, protocol: PROTOCOL, tier: 'scaffold' }
}
async ready () { return true }
_notImplemented (method) {
this._stats.errors++
throw new Error(`not implemented: scaffold (${method})`)
}
}
module.exports = { HyperP2PCreditLedger, PROTOCOL }