Saxonberg Server API
    Preparing search index...
    Index

    Constructors

    Methods

    • Boot seam (idempotent). The warm caches are loaded separately by AccountBalance.warm() / SupplyAggregate.warm() (awaited in AppBootstrap before this). Activation = the singleton's presence.

      Returns void

    • The corpo affiliation recorded on an account (readable via corpo).

      Parameters

      • accountId: string

      Returns Promise<string | null>

    • Drain money out of an account — the central-bank sink. Supply shrinks by amount; one logged drain row to the issuance sentinel. Throws if the account holds less than amount.

      Parameters

      • fromAccountId: string
      • amount: Money
      • memo: string = ""

      Returns Promise<void>

    • Ensure a venue's P&L account exists (owner = the venue's durable path), creating a primary one if absent — lazily, on first banking interaction at the venue. The bar's account the order/pnl/payroll flows resolve.

      Parameters

      • ownerPath: string
      • bankPath: string
      • corpoKey: string

      Returns Promise<string>

    • Mint money into an account — the central-bank faucet. Supply grows by amount; one logged mint row from the issuance sentinel to the target. Developer-gated at the verb layer; the actor is the context-derived author, never a parameter.

      Parameters

      • toAccountId: string
      • amount: Money
      • memo: string = ""
      • category: PnlCategory = "float"

      Returns Promise<void>

    • The acting owner's account id at bankPath (no number typed).

      Parameters

      • bankPath: string

      Returns Promise<string | null>

    • Open the acting owner's account at a branch (idempotent). The first account an owner opens becomes their primary (receive-by-identity default); the bank's corpoKey affiliation is recorded on the row. The owner is the context-derived author, never a parameter. Returns the durable account id.

      Parameters

      • bankPath: string
      • corpoKey: string

      Returns Promise<string>

    • Pay a wage from an employer account to a worker's primary account — the P&L's labor line (wage/wages). Who is employed is authored; this is the payment only. Developer/employer-gated at the verb layer.

      Parameters

      • employerAccountId: string
      • workerKey: string
      • amount: Money

      Returns Promise<void>

    • The ownerKey's primary account id — the receive-by-identity target.

      Parameters

      • ownerKey: string

      Returns Promise<string | null>

    • A categorized read of an account's ledger — the bar's P&L: per-category signed net flow + a running balance that sits red by design (Law 1: a count, not a worth-assertion). A derive-on-read consumer, no backfill.

      Parameters

      • accountId: string

      Returns Promise<ProfitAndLoss>

    • Replay the ledger for accountId into its balance — the audit seam. Byte-identical to the materialized cache (the rebuild-from-log invariant).

      Parameters

      • accountId: string

      Returns Promise<Money>

    • Remit the demo sales tax on a sale from the seller's account to the placeholder treasury at the authored, inert rate — seller-collected, so it shows in the seller's P&L as a tax line; the treasury merely accumulates (no appropriation path). Returns the tax remitted (zero when the rate is absent). The bar loop calls this at point of sale.

      Parameters

      • sellerAccountId: string
      • saleAmount: Money

      Returns Promise<Money>

    • Transfer balance → balance (conserving); only from your own account.

      Parameters

      • fromAccountId: string
      • toAccountId: string
      • amount: Money
      • memo: string = ""

      Returns Promise<void>