Expand economy, autobase, network, observability, and scheduling modules.
Add auction withdraw/cancel, marketplace search helpers, update gossip history, autobase fork/lease/indexer/view APIs, link-probe and circuit-loom utilities, trace trees, pheromone ranking, and scheduling/measurement helpers with tests. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -64,6 +64,18 @@ class HyperP2PCreditLedger extends EventEmitter {
|
||||
return sum
|
||||
}
|
||||
|
||||
topBalances (limit = 5) {
|
||||
return [...this._accounts.values()]
|
||||
.sort((a, b) => b.balance - a.balance)
|
||||
.slice(0, Math.max(0, limit | 0))
|
||||
.map((a) => ({ id: a.id, balance: a.balance }))
|
||||
}
|
||||
|
||||
accountSnapshot (accountId) {
|
||||
const a = this._accounts.get(accountId)
|
||||
return a ? { id: a.id, balance: a.balance, updatedAt: a.updatedAt } : null
|
||||
}
|
||||
|
||||
_apply (accountId, delta, kind, reason) {
|
||||
assertNonEmpty(accountId, 'accountId')
|
||||
const acct = this._accounts.get(accountId)
|
||||
|
||||
Reference in New Issue
Block a user