Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

542 B
Raw Blame
import { payout } from './charge.js';
import * as store from './store.js';
import { deriveKey, once } from './idempotency.js';

// Processes a vendor payout through the same shared idempotency helper as
// refunds, so a retry storm can never double-pay a vendor.
export async function processPayout(req) {
  const key = req.idempotencyKey
    ? `payout:${req.idempotencyKey}`
    : deriveKey('payout', { vendorId: req.vendorId, amount: req.amount });
  return once(store, key, () => payout({ vendorId: req.vendorId, amount: req.amount }));
}