app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

operation-transactions.ts (509B)


      1 // Pure storage mechanics shared by typed operation repositories. This module
      2 // acquires no database, signer, relay, raw-event publisher or account authority.
      3 // Matching the original base is an observation, not proof of global absence.
      4 export function decideFrozenTransition(
      5   currentWire: unknown,
      6   baseWire: string,
      7   nextWire: string
      8 ): 'committed' | 'base_observed' | 'conflict' {
      9   if (currentWire === nextWire) return 'committed';
     10   return currentWire === baseWire ? 'base_observed' : 'conflict';
     11 }