Eve library

@lilith/transaction-core

Other

Revision 1

On this page

Shared primitives and flow helpers for transaction-oriented services (transaction-manager, payment-orchestrator, settlement).

What’s inside#

  • TransactionStatus constants and a guard nextState to enforce valid transitions.
  • buildTransactionId(prefix?) to generate idempotent-friendly IDs.
  • validateTransferRequest to flag missing transfer fields (from, to, amount).

Usage#

js
const { TransactionStatus, nextState, buildTransactionId } = require('@lilith/transaction-core');

const id = buildTransactionId('payment');
let state = TransactionStatus.PENDING;
state = nextState(state, TransactionStatus.PREPARING);

Notes#

  • Keep helpers small and composable; this library is a convenience layer, not a framework.
  • Extend with additional validators or metrics wrappers as other transaction services converge on shared patterns.