Skip to content

💰 Currency / Internal

🎯 Purpose

The Internal layer contains private implementation helpers, decorators, guards, caches, and runtime plumbing used by the Currency system.

These types support composition, authority resolution, policy application, auditing, batching, escrow, idempotency, and resolver override behaviour.

This folder is not part of the supported extension surface.


⚠️ Important Notes

  • This folder is not a supported dependency surface
  • Types here may change without notice
  • External code should not depend on this folder
  • Public contracts are defined in Abstractions and PublicAPI

🧩 What Lives Here

Internal helpers

  • CurrencyAuthority Scene-scoped resolver and cache for ICurrencyAuthority

  • CurrencyBatch Internal capture helper for CurrencyDelta batching

  • CurrencyPolicyUtil Helper for applying policy rules to balances

  • CurrencyRequestId GUID-based request identifier helper

  • CurrencyServiceOverride Resolver override used by bootstrap publishing


Internal seams

  • ICurrencyBatchEmitter Internal seam for batch event emission

  • IAuditAwareCurrencyService Public capability (defined in Abstractions) that may be forwarded internally


Internal decorators / guards

Concrete runtime wrappers used for composition:

  • AuditedCurrencyService — audit capture and forwarding
  • BatchEventCurrencyService — batch event support
  • CappedCurrencyService — cap enforcement
  • EscrowCurrencyService — escrow lifecycle handling
  • IdempotencyCurrencyService — replay detection
  • RequireEscrowCurrencyService — guard for escrow-required flows

These implementations are internal to keep the public API surface stable.


🧠 Usage Guidance

Mental model

  • Abstractions define contracts
  • PublicAPI defines supported usage
  • Bootstrap composes stacks
  • Internal performs runtime work

External code should interact with Currency through supported layers only.


🚫 Internal Use Only

This folder is intended for internal runtime implementation.

Do not:

  • Reference these types from gameplay code
  • Build integrations against these implementations
  • Rely on behaviour or structure remaining stable

🧹 Safe to Remove

This folder should not be removed.

Core Currency functionality depends on these internal implementations.


  • Abstractions — public contracts and capabilities
  • PublicAPI — supported usage helpers
  • Bootstrap — service composition and publishing
  • Authority — mutation gating seam
  • Policies — rule definitions used by internal helpers